diff --git a/web/src/api/admin/users.ts b/web/src/api/admin/users.ts new file mode 100644 index 0000000..a1cdb60 --- /dev/null +++ b/web/src/api/admin/users.ts @@ -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 => { + const response = await axios.get("/api/v1/admin/users"); + + if (response.status !== 200 && response.status !== 201) + throw await handleApiError(response); + + return response.data; +};