feat: fetch users API

This commit is contained in:
2025-06-04 12:46:36 +02:00
parent c6998f33e1
commit 9895392b50

View File

@ -0,0 +1,16 @@
import type { UserProfile } from "@/types";
import { axios, handleApiError } from "..";
export interface FetchUsersResponse {
items: UserProfile[];
count: number;
}
export const adminGetUsersApi = async (): Promise<FetchUsersResponse> => {
const response = await axios.get<FetchUsersResponse>("/api/v1/admin/users");
if (response.status !== 200 && response.status !== 201)
throw await handleApiError(response);
return response.data;
};