Skip to content

Commit

Permalink
fix(org): fix org detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
abulte committed Dec 11, 2023
1 parent aa9e0fd commit b17caf8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions configs/ecospheres/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ website:
linkPage: '/datasets'
type: 'component'
display_menu: true
- name: 'Organisations'
id: 'organizations'
linkPage: '/organizations'
type: 'component'
display_menu: false
- name: 'Bouquets'
id: 'bouquets'
linkPage: '/bouquets'
Expand Down
4 changes: 2 additions & 2 deletions src/services/api/resources/DatasetsAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ export default class DatasetsAPI extends DatagouvfrAPI {
* @param {str?} sort
* @returns {object}
*/
async getDatasetsForOrganization(org_id, page = 1, sort = '-created') {
async getDatasetsForOrganization(orgId, page = 1, sort = '-created') {
// WARNING: specify `-created` or another sort explicitely because default sort has a pagination issue
const url = `${this.url()}/?organization=${org_id}&page=${page}&sort=${sort}&page_size=21`
const url = `${this.url()}/search/?organization=${orgId}&page=${page}&sort=${sort}&page_size=21`
return await this.makeRequestAndHandleResponse(url)
}
}
10 changes: 5 additions & 5 deletions src/store/DatasetStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ export const useDatasetStore = defineStore('dataset', {
* @param {string?} sort Sort order requested
* @returns {Array<object>}
*/
async loadDatasetsForOrg(org_id, page = 1, sort = '-created') {
const existing = this.getDatasetsForOrg(org_id, page, sort)
async loadDatasetsForOrg(orgId, page = 1, sort = '-created') {
const existing = this.getDatasetsForOrg(orgId, page, sort)
if (existing.data) return existing
const datasets = await datasetsApiv2.getDatasetsForOrganization(
org_id,
orgId,
page,
sort
)
this.addDatasets(org_id, datasets, sort)
return this.getDatasetsForOrg(org_id, page, sort)
this.addDatasets(orgId, datasets, sort)
return this.getDatasetsForOrg(orgId, page, sort)
},
/**
* Store the result of a datasets fetch operation for an org in store
Expand Down

0 comments on commit b17caf8

Please sign in to comment.