@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.
24 lines (23 loc) • 1.06 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] = "3986f00f-7a0a-4309-8d1d-4fdcd600bba6", e._sentryDebugIdIdentifier = "sentry-dbid-3986f00f-7a0a-4309-8d1d-4fdcd600bba6");
} catch (e) {}
import { n as httpGet, s as useApiContext } from "./http-8qgzqVqk.js";
import { useQuery } from "@tanstack/preact-query";
//#region src/api/taskStatus/useTaskStatus.ts
var getTaskStatus = async (legalEntityId, baseUrl, taskType) => {
return httpGet({
baseUrl,
path: `legalEntities/${legalEntityId}/taskStatus/${taskType}`
});
};
var useTaskStatus = (taskType, options) => {
const { rootLegalEntityId, baseUrl } = useApiContext();
return useQuery({
queryKey: ["taskStatus", taskType],
queryFn: () => getTaskStatus(rootLegalEntityId.value, baseUrl.value, taskType),
...options
});
};
//#endregion
export { useTaskStatus as t };