Skip to content

Commit

Permalink
fix(structure): filter out people with no role when requesting the wh…
Browse files Browse the repository at this point in the history
…ole staff
  • Loading branch information
davidsandoz committed Apr 18, 2024
1 parent 9d5080c commit b928771
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/cms-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,9 @@ const cmsService: Plugin = (context, inject) => {
filter = { roles: { roles_id: { group: { id: groupId } } } };
} else if (groupSlug) {
filter = { roles: { roles_id: { group: { translations: { slug: groupSlug } } } } };
} else {
// If no group is provided (i.e. the whole staff is requested), we filter the people that don't have any role
filter = { roles: { _null: false } };
}

const peopleResponse = await context.$directus.request<DirectusPerson[]>(
Expand Down

0 comments on commit b928771

Please sign in to comment.