Renaming of rest resources
This commit is contained in:
parent
e6ed2825e2
commit
1487bb73a1
9 changed files with 5 additions and 5 deletions
26
frontend/src/api/endpoints/UserRestResource.ts
Normal file
26
frontend/src/api/endpoints/UserRestResource.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import {apiClient} from "../apiClient";
|
||||
import type {UserDto} from "../dtos/UserDto";
|
||||
import type {CreateUserRequest} from "../dtos/CreateUserRequest.ts";
|
||||
import type {ChangeUserPasswordRequest} from "../dtos/ChangeUserPasswordRequest.ts";
|
||||
import type {CreateUserResponse} from "../dtos/CreateUserResponse.ts";
|
||||
import type {UserListResponse} from "../dtos/UserListResponse.ts";
|
||||
|
||||
export async function fetchCurrentUser(): Promise<UserDto> {
|
||||
return apiClient.get("/user/me");
|
||||
}
|
||||
|
||||
export async function fetchAllUsers(): Promise<UserListResponse> {
|
||||
return apiClient.get("/user/all");
|
||||
}
|
||||
|
||||
export async function createUser(dto: CreateUserRequest): Promise<CreateUserResponse> {
|
||||
return apiClient.post("/user/create", dto);
|
||||
}
|
||||
|
||||
export async function updateUser(dto: UserDto): Promise<UserDto> {
|
||||
return apiClient.post("/user/update", dto);
|
||||
}
|
||||
|
||||
export async function changePassword(dto: ChangeUserPasswordRequest) {
|
||||
return apiClient.post("/user/change-password", dto);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue