feat: get single user API

This commit is contained in:
2025-06-04 19:33:07 +02:00
parent 0dcef81b59
commit d9e9c5ab38

View File

@ -14,3 +14,18 @@ export const adminGetUsersApi = async (): Promise<FetchUsersResponse> => {
return response.data;
};
export type FetchUserResponse = UserProfile;
export const adminGetUserApi = async (
id: string,
): Promise<FetchUserResponse> => {
const response = await axios.get<FetchUserResponse>(
`/api/v1/admin/users/${id}`,
);
if (response.status !== 200 && response.status !== 201)
throw await handleApiError(response);
return response.data;
};