Prevent lookup if not enabled

This commit is contained in:
Chewbacca
2023-06-02 10:28:10 -04:00
parent 14aafa2526
commit 53988e2581
2 changed files with 5 additions and 2 deletions

View File

@@ -12,7 +12,7 @@ function useGroupLookup(slug: string) {
Entities.GROUPS,
(group) => group.slug === slug,
() => api.get(`/api/v1/groups/lookup?name=${slug}`),
{ schema: groupSchema },
{ schema: groupSchema, enabled: !!slug },
);
const { entity: relationship } = useGroupRelationship(group?.id);