diff --git a/lib/api/account.ts b/lib/api/account.ts new file mode 100644 index 0000000..83bb823 --- /dev/null +++ b/lib/api/account.ts @@ -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({ + url: apiUrl + "/account", + contentType: true, + method: "PATCH", + useToken: true, + withCredentials: false, + body: user, + }); +} + +export function createUserAccount(signal: AbortSignal) { + return makeRequest({ + url: apiUrl + "/account", + contentType: true, + method: "POST", + useToken: true, + withCredentials: false, + signal, + }); +} diff --git a/lib/api/index.ts b/lib/api/index.ts index 11614ef..7f6a1ee 100644 --- a/lib/api/index.ts +++ b/lib/api/index.ts @@ -1,3 +1,4 @@ +export * from "./account"; export * from "./makeRequest"; export * from "./tariff"; -export * from "./tickets"; \ No newline at end of file +export * from "./tickets"; diff --git a/package.json b/package.json index 5e95860..8d36cbd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@frontend/kitui", - "version": "1.0.40", + "version": "1.0.41", "description": "test", "main": "./dist/index.js", "module": "./dist/index.js",