add account api functions
This commit is contained in:
parent
77a8ff5cc0
commit
31058d1604
26
lib/api/account.ts
Normal file
26
lib/api/account.ts
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
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,
|
||||||
|
});
|
||||||
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
export * from "./account";
|
||||||
export * from "./makeRequest";
|
export * from "./makeRequest";
|
||||||
export * from "./tariff";
|
export * from "./tariff";
|
||||||
export * from "./tickets";
|
export * from "./tickets";
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@frontend/kitui",
|
"name": "@frontend/kitui",
|
||||||
"version": "1.0.40",
|
"version": "1.0.41",
|
||||||
"description": "test",
|
"description": "test",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"module": "./dist/index.js",
|
"module": "./dist/index.js",
|
||||||
|
Loading…
Reference in New Issue
Block a user