Update usages of useGroupRelationships hook
This commit is contained in:
parent
242c6026d5
commit
cb4477185c
5 changed files with 14 additions and 5 deletions
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue