UIKit/lib/api/account.ts

28 lines
725 B
TypeScript

import { UserAccount, UserName } from "../model/account";
import { makeRequest } from "./makeRequest";
const apiUrl = process.env.REACT_APP_DOMAIN + "/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, url: string = apiUrl + "/account") {
return makeRequest<never, UserAccount>({
url: url,
contentType: true,
method: "POST",
useToken: true,
withCredentials: false,
signal,
});
}