Raid Layout page working

This commit is contained in:
2025-03-09 12:15:29 -04:00
parent c2f13d9900
commit 8b8538a968
15 changed files with 973 additions and 0 deletions

View File

@@ -52,6 +52,25 @@ export function useGetClassGroupsCount(raidGroupId: string, searchTerm?: string)
});
}
export function useGetClassGroupsByRaidLayout(raidGroupId: string, raidLayoutId: string | undefined){
return useQuery({
queryKey: ["classGroups", "raidLayout", raidLayoutId],
queryFn: async () => {
const response = await api.get(`/raidGroup/${raidGroupId}/classGroup/raidLayout/${raidLayoutId}`);
if(response.status !== 200){
throw new Error("Failed to get class groups");
}
else if(response.data.error){
throw new Error(response.data.errors.join(", "));
}
return response.data as (ClassGroup | null)[];
},
enabled: !!raidLayoutId
})
}
export function useCreateClassGroup(raidGroupId: string){
const queryClient = useQueryClient();