* fix: remove validation of roles from the live server * chore: remove the service * fix: remove all validation of authorization * fix: props updated
28 lines
583 B
TypeScript
28 lines
583 B
TypeScript
// types
|
|
import type { IUser } from "@plane/types";
|
|
// services
|
|
import { API_BASE_URL, APIService } from "@/core/services/api.service.js";
|
|
|
|
export class UserService extends APIService {
|
|
constructor() {
|
|
super(API_BASE_URL);
|
|
}
|
|
|
|
currentUserConfig() {
|
|
return {
|
|
url: `${this.baseURL}/api/users/me/`,
|
|
};
|
|
}
|
|
|
|
async currentUser(cookie: string): Promise<IUser> {
|
|
return this.get("/api/users/me/", {
|
|
headers: {
|
|
Cookie: cookie,
|
|
},
|
|
})
|
|
.then((response) => response?.data)
|
|
.catch((error) => {
|
|
throw error;
|
|
});
|
|
}
|
|
}
|