feat: get single user API
This commit is contained in:
@ -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;
|
||||
};
|
||||
|
Reference in New Issue
Block a user