Skip to content

Commit

Permalink
fix(web-devtools): fix-use-dispute-template-from-id-hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Harman-singh-waraich committed Oct 11, 2024
1 parent 00c933d commit a8a597d
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions web-devtools/src/hooks/queries/useDisputeTemplateFromId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,12 @@ export const useDisputeTemplateFromId = (templateId?: string) => {
queryKey: [`disputeTemplate${templateId}`],
enabled: isEnabled,
staleTime: Infinity,
queryFn: async () => {
const response = await graphqlBatcher.fetch({
queryFn: async () =>
await graphqlBatcher.fetch({
id: crypto.randomUUID(),
document: disputeTemplateQuery,
variables: { id: templateId?.toString() },
isDisputeTemplate: true,
});
if (!response || response.errors) {
throw new Error("Failed to fetch dispute template: " + response?.errors?.[0]?.message);
}
return response.data;
},
}),
});
};

0 comments on commit a8a597d

Please sign in to comment.