feat: update updateUser method to use Partial<User> for improved type safety

- Refactored `updateUser` method in `admin.service.ts` to accept `Partial<User>` instead of `any`.
- Added `User` type import for more precise typing.
This commit is contained in:
Mathis HERRIOT
2026-01-29 16:06:45 +01:00
parent 5b05a14932
commit 484b775923

View File

@@ -1,4 +1,5 @@
import api from "@/lib/api";
import type { User } from "@/types/user";
import type { Report, ReportStatus } from "./report.service";
export interface AdminStats {
@@ -29,7 +30,7 @@ export const adminService = {
await api.delete(`/users/${userId}`);
},
updateUser: async (userId: string, data: any): Promise<void> => {
updateUser: async (userId: string, data: Partial<User>): Promise<void> => {
await api.patch(`/users/admin/${userId}`, data);
},
};