// types import { IUser, TUserProfile } from "@plane/types"; // helpers import { API_BASE_URL } from "@/helpers/common.helper"; // services import APIService from "@/services/api.service"; export class UserService extends APIService { constructor() { super(API_BASE_URL); } async currentUser(): Promise { return this.get("/api/users/me/") .then((response) => response?.data) .catch((error) => { throw error?.response; }); } async updateUser(data: Partial): Promise { return this.patch("/api/users/me/", data) .then((response) => response?.data) .catch((error) => { throw error?.response?.data; }); } async getCurrentUserProfile(): Promise { return this.get("/api/users/me/profile/") .then((response) => response?.data) .catch((error) => { throw error?.response; }); } async updateCurrentUserProfile(data: Partial): Promise { return this.patch("/api/users/me/profile/", data) .then((response) => response?.data) .catch((error) => { throw error?.response; }); } }