Update usages of useGroupRelationships hook

This commit is contained in:
Alex Gleason 2023-06-26 11:25:03 -05:00
parent 242c6026d5
commit cb4477185c
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
5 changed files with 14 additions and 5 deletions

View file

@ -21,7 +21,10 @@ function useGroupSearch(search: string) {
{ enabled: features.groupsDiscovery && !!search, schema: groupSchema },
);
const { relationships } = useGroupRelationships(entities.map(entity => entity.id));
const { relationships } = useGroupRelationships(
['discover', 'search', search],
entities.map(entity => entity.id),
);
const groups = entities.map((group) => ({
...group,

View file

@ -15,7 +15,10 @@ function useGroups(q: string = '') {
() => api.get('/api/v1/groups', { params: { q } }),
{ enabled: features.groups, schema: groupSchema },
);
const { relationships } = useGroupRelationships(entities.map(entity => entity.id));
const { relationships } = useGroupRelationships(
['search', q],
entities.map(entity => entity.id),
);
const groups = entities.map((group) => ({
...group,

View file

@ -19,7 +19,10 @@ function useGroupsFromTag(tagId: string) {
enabled: features.groupsDiscovery,
},
);
const { relationships } = useGroupRelationships(entities.map(entity => entity.id));
const { relationships } = useGroupRelationships(
['tags', tagId],
entities.map(entity => entity.id),
);
const groups = entities.map((group) => ({
...group,

View file

@ -20,7 +20,7 @@ function usePopularGroups() {
},
);
const { relationships } = useGroupRelationships(entities.map(entity => entity.id));
const { relationships } = useGroupRelationships(['popular'], entities.map(entity => entity.id));
const groups = entities.map((group) => ({
...group,

View file

@ -18,7 +18,7 @@ function useSuggestedGroups() {
},
);
const { relationships } = useGroupRelationships(entities.map(entity => entity.id));
const { relationships } = useGroupRelationships(['suggested'], entities.map(entity => entity.id));
const groups = entities.map((group) => ({
...group,