Skip to content

Commit

Permalink
Increase the page size for projects queries (#598)
Browse files Browse the repository at this point in the history
Increase the page size for projects and project roles queries to match the number of project IDs included in each query.
  • Loading branch information
eatyourgreens authored Jul 21, 2023
1 parent 8d22cbb commit 17bb51b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/store/ProjectsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const ProjectsStore = types.model('ProjectsStore', {

getRoles: flow (function * getRoles(ids = []) {
const user = getRoot(self).auth.user
const roles = yield apiClient.type('project_roles').get({ user_id: user.id, project_id: ids })
const roles = yield apiClient.type('project_roles').get({ user_id: user.id, project_id: ids, page_size: ids.length })
self.roles = roles.reduce((roles, role) => {
let title = ROLES.VIEWER
if (role.roles.some(role => editorRoles.includes(role))) { title = ROLES.EDITOR }
Expand All @@ -54,7 +54,7 @@ const ProjectsStore = types.model('ProjectsStore', {
const response = yield client.get('/projects')
const resources = JSON.parse(response.body)
const ids = resources.data.map(project => project.id)
const projects = yield apiClient.type('projects').get({ id: ids.toString(), cards: true })
const projects = yield apiClient.type('projects').get({ id: ids.toString(), cards: true, page_size: ids.length })
yield self.getRoles(ids)

projects.forEach((project) => {
Expand Down

0 comments on commit 17bb51b

Please sign in to comment.