import { PatchUserRequest, User } from "@root/model/user"; import { authStore } from "@root/stores/makeRequest"; const apiUrl = process.env.NODE_ENV === "production" ? "" : "https://hub.pena.digital"; const makeRequest = authStore.getState().makeRequest; export function getUser(userId: string): Promise { return makeRequest({ url: `${apiUrl}/user/${userId}`, contentType: true, method: "GET", useToken: false, withCredentials: false, }); } export function patchUser(user: PatchUserRequest) { return makeRequest({ url: apiUrl + "/user/", contentType: true, method: "PATCH", useToken: true, withCredentials: false, body: user, }); }