UNPKG

@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.

25 lines (24 loc) 1.07 kB
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] = "bb9d5a7a-fb42-4386-9bbc-99fa06127433", e._sentryDebugIdIdentifier = "sentry-dbid-bb9d5a7a-fb42-4386-9bbc-99fa06127433"); } catch (e) {} import { r as httpPost, s as useApiContext } from "./http-D1NDkBxF.js"; import { useMutation } from "@tanstack/preact-query"; //#region src/api/createLegalEntity/useCreateLegalEntity.ts var createLegalEntity = async (legalEntityId, baseUrl, data) => { return httpPost({ baseUrl, path: `legalEntities/${legalEntityId}/create` }, data); }; var useCreateLegalEntity = (options) => { const { rootLegalEntityId, baseUrl } = useApiContext(); return useMutation({ mutationFn: (payload) => { return createLegalEntity(rootLegalEntityId.value, baseUrl.value, payload); }, ...options }); }; //#endregion export { useCreateLegalEntity as t };