add basic user management
This commit is contained in:
parent
09150ba3bb
commit
9e7ad622f9
12 changed files with 673 additions and 35 deletions
24
frontend/src/api/points/UserPoint.ts
Normal file
24
frontend/src/api/points/UserPoint.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import {apiClient} from "../apiClient";
|
||||
import type {UserDto} from "../dtos/UserDto";
|
||||
import type {CreateUserRequestDto} from "../dtos/CreateUserRequestDto";
|
||||
import type {ChangeUserPasswordRequestDto} from "../dtos/ChangeUserPasswordRequestDto";
|
||||
|
||||
export async function fetchCurrentUser(): Promise<UserDto> {
|
||||
return apiClient.get("/user/me");
|
||||
}
|
||||
|
||||
export async function fetchAllUsers(): Promise<UserDto[]> {
|
||||
return apiClient.get("/user/list");
|
||||
}
|
||||
|
||||
export async function createUser(dto: CreateUserRequestDto): Promise<UserDto> {
|
||||
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: ChangeUserPasswordRequestDto) {
|
||||
return apiClient.post("/user/change-password", dto);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue