mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
add updateMe method to user API service
This commit is contained in:
parent
f9a7b3875a
commit
0ba5de511e
1 changed files with 14 additions and 1 deletions
|
|
@ -1,4 +1,8 @@
|
|||
import { getMeResponse } from "@/contracts/types/user.types";
|
||||
import {
|
||||
getMeResponse,
|
||||
updateUserResponse,
|
||||
type UpdateUserRequest,
|
||||
} from "@/contracts/types/user.types";
|
||||
import { baseApiService } from "./base-api.service";
|
||||
|
||||
class UserApiService {
|
||||
|
|
@ -8,6 +12,15 @@ class UserApiService {
|
|||
getMe = async () => {
|
||||
return baseApiService.get(`/users/me`, getMeResponse);
|
||||
};
|
||||
|
||||
/**
|
||||
* Update current authenticated user
|
||||
*/
|
||||
updateMe = async (request: UpdateUserRequest) => {
|
||||
return baseApiService.patch(`/users/me`, updateUserResponse, {
|
||||
body: request,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export const userApiService = new UserApiService();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue