251209:1453 Frontend: progress nest = UAT & Bug Fixing
Some checks failed
Spec Validation / validate-markdown (push) Has been cancelled
Spec Validation / validate-diagrams (push) Has been cancelled
Spec Validation / check-todos (push) Has been cancelled

This commit is contained in:
admin
2025-12-09 14:53:42 +07:00
parent 8aceced902
commit aa96cd90e3
125 changed files with 11052 additions and 785 deletions

View File

@@ -3,11 +3,19 @@ import { CreateUserDto, UpdateUserDto, SearchUserDto, User } from "@/types/user"
export const userService = {
getAll: async (params?: SearchUserDto) => {
const response = await apiClient.get<User[]>("/users", { params });
// Assuming backend returns array or paginated object.
// If backend uses standard pagination { data: [], total: number }, adjust accordingly.
// Based on previous code checks, it seems simple array or standard structure.
// Let's assume standard response for now.
const response = await apiClient.get<any>("/users", { params });
// Unwrap NestJS TransformInterceptor response
if (response.data?.data) {
return response.data.data as User[];
}
return response.data as User[];
},
getRoles: async () => {
const response = await apiClient.get<any>("/users/roles");
if (response.data?.data) {
return response.data.data;
}
return response.data;
},