first
Deploy Iddaai Frontend / build-and-deploy (push) Successful in 4m0s

This commit is contained in:
2026-04-16 13:36:34 +03:00
parent de5e145c4e
commit fc7a1ba567
218 changed files with 32370 additions and 0 deletions
+60
View File
@@ -0,0 +1,60 @@
import { apiRequest } from "@/lib/api/api-service";
import { ApiResponse } from "@/types/api-response";
/**
* Users Service
* Backend: /api/users/*
*/
export interface UpdateProfileDto {
firstName?: string;
lastName?: string;
}
export interface ChangePasswordDto {
currentPassword: string;
newPassword: string;
}
export interface UserResponseDto {
id: string;
email: string;
firstName: string | null;
lastName: string | null;
role: string;
isActive: boolean;
createdAt: string;
updatedAt: string;
}
const getMe = () => {
return apiRequest<ApiResponse<UserResponseDto>>({
url: "/users/me",
client: "core",
method: "get",
});
};
const updateMe = (dto: UpdateProfileDto) => {
return apiRequest<ApiResponse<UserResponseDto>>({
url: "/users/me",
client: "core",
method: "put",
data: dto,
});
};
const changePassword = (dto: ChangePasswordDto) => {
return apiRequest<ApiResponse<null>>({
url: "/users/me/password",
client: "core",
method: "patch",
data: dto,
});
};
export const usersService = {
getMe,
updateMe,
changePassword,
};