@adyen/kyc-components
Version:
This guide assumes that you have already an account with Adyen. A legalEntity needs to be created, and you need to have a `legalEntityId` to instatiate a Component.
32 lines (31 loc) • 1.54 kB
JavaScript
try {
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "08955a1b-39c5-4c86-aeaf-42cfaf04f724", e._sentryDebugIdIdentifier = "sentry-dbid-08955a1b-39c5-4c86-aeaf-42cfaf04f724");
} catch (e) {}
import { s as useApiContext, t as httpDelete } from "./http-D1NDkBxF.js";
import { t as useInvalidateRootLegalEntity } from "./invalidateRootLegalEntity-CZr0iiji.js";
import { useMutation } from "@tanstack/preact-query";
//#region src/api/transferInstruments/useDeleteTransferInstrument.ts
var deleteTransferInstrument = async (legalEntityId, baseUrl, transferInstrumentId) => {
return httpDelete({
baseUrl,
path: `legalEntities/${legalEntityId}/transferInstruments/${transferInstrumentId}`
});
};
/**
* Deletes a transfer instrument associated with a legal entity
* @param options additional options passed to Tanstack Query, eg; onSuccess
*/
var useDeleteTransferInstrument = (options) => {
const { rootLegalEntityId, baseUrl } = useApiContext();
const invalidateRootLegalEntity = useInvalidateRootLegalEntity();
return useMutation({
mutationFn: (transferInstrumentId) => deleteTransferInstrument(rootLegalEntityId.value, baseUrl.value, transferInstrumentId),
onSuccess: async () => {
await invalidateRootLegalEntity();
},
...options
});
};
//#endregion
export { useDeleteTransferInstrument as t };