UIKit/lib/api/account.ts
2023-08-28 17:18:03 +03:00

27 lines
720 B
TypeScript

import { UserAccount, UserName, makeRequest } from "@frontend/kitui";
const apiUrl = process.env.NODE_ENV === "production" ? "/customer" : "https://hub.pena.digital/customer";
export function patchUserAccount(user: UserName) {
return makeRequest<UserName, UserAccount>({
url: apiUrl + "/account",
contentType: true,
method: "PATCH",
useToken: true,
withCredentials: false,
body: user,
});
}
export function createUserAccount(signal: AbortSignal) {
return makeRequest<never, UserAccount>({
url: apiUrl + "/account",
contentType: true,
method: "POST",
useToken: true,
withCredentials: false,
signal,
});
}