Add useRelationship hook, disable fetching relationship for account by default

This commit is contained in:
Alex Gleason
2023-06-25 12:01:34 -05:00
parent ec8177d578
commit 072014e39e
5 changed files with 54 additions and 13 deletions

View File

@@ -16,7 +16,7 @@ function useGroupRelationship(groupId: string | undefined) {
() => api.get(`/api/v1/groups/relationships?id[]=${groupId}`),
{
enabled: !!groupId,
schema: z.array(groupRelationshipSchema).transform(arr => arr[0]),
schema: z.array(groupRelationshipSchema).nonempty().transform(arr => arr[0]),
},
);