plane/space/services/user.service.ts
Anmol Singh Bhatia 0e1ee80512
chore: updated plane deploy sign-in workflows for cloud and self-hosted instances (#2999)
* chore: deploy onboarding workflow

* chore: sign in workflow improvement

* fix: build error
2023-12-06 16:42:57 +05:30

29 lines
667 B
TypeScript

// services
import APIService from "services/api.service";
// helpers
import { API_BASE_URL } from "helpers/common.helper";
// types
import { IUser } from "types/user";
export class UserService extends APIService {
constructor() {
super(API_BASE_URL);
}
async currentUser(): Promise<IUser> {
return this.get("/api/users/me/")
.then((response) => response?.data)
.catch((error) => {
throw error?.response;
});
}
async updateMe(data: any): Promise<any> {
return this.patch("/api/users/me/", data)
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
}