fix(dashboard,js-sdk): remove method and hook for deleting claim (#9668)
This commit is contained in:
@@ -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 = (
|
export const useAddClaimItems = (
|
||||||
id: string,
|
id: string,
|
||||||
orderId: string,
|
orderId: string,
|
||||||
|
|||||||
@@ -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(
|
async addItems(
|
||||||
id: string,
|
id: string,
|
||||||
body: HttpTypes.AdminAddClaimItems,
|
body: HttpTypes.AdminAddClaimItems,
|
||||||
|
|||||||
Reference in New Issue
Block a user