plane/space/services/user.service.ts
2023-12-01 19:04:25 +05:30

29 lines
642 B
TypeScript

// services
import APIService from "services/api.service";
// helpers
import { API_BASE_URL } from "helpers/common.helper";
class UserService extends APIService {
constructor() {
super(API_BASE_URL);
}
async currentUser(): Promise<any> {
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;
});
}
}
export default UserService;