Skip to content

Commit

Permalink
fix(dashboard,js-sdk): remove method and hook for deleting claim (#9668)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser authored Oct 18, 2024
1 parent 61e6a07 commit 2ea766d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 43 deletions.
28 changes: 0 additions & 28 deletions packages/admin/dashboard/src/hooks/api/claims.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,34 +119,6 @@ export const useCancelClaim = (
})
}

export const useDeleteClaim = (
id: string,
orderId: string,
options?: UseMutationOptions<HttpTypes.AdminClaimDeleteResponse, FetchError>
) => {
return useMutation({
mutationFn: () => sdk.admin.claim.delete(id),
onSuccess: (data: any, variables: any, context: any) => {
queryClient.invalidateQueries({
queryKey: ordersQueryKeys.details(),
})

queryClient.invalidateQueries({
queryKey: ordersQueryKeys.preview(orderId),
})

queryClient.invalidateQueries({
queryKey: claimsQueryKeys.details(),
})
queryClient.invalidateQueries({
queryKey: claimsQueryKeys.lists(),
})
options?.onSuccess?.(data, variables, context)
},
...options,
})
}

export const useAddClaimItems = (
id: string,
orderId: string,
Expand Down
15 changes: 0 additions & 15 deletions packages/core/js-sdk/src/admin/claim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,6 @@ export class Claim {
)
}

async delete(
id: string,
query?: HttpTypes.SelectParams,
headers?: ClientHeaders
) {
return await this.client.fetch<HttpTypes.AdminClaimDeleteResponse>(
`/admin/claims/${id}`,
{
method: "DELETE",
headers,
query,
}
)
}

async addItems(
id: string,
body: HttpTypes.AdminAddClaimItems,
Expand Down

0 comments on commit 2ea766d

Please sign in to comment.