Files
PoleDanceApp/web/src/lib/api/users.ts
Dianaka123 9fcd7c1d63 POL-124: Migrate frontend from React Native to Next.js web app
- Replace mobile/ (Expo) with web/ (Next.js 16 + Tailwind + shadcn/ui)
- Pages: login, register, pending, championships, championship detail, registrations, profile, admin
- Logic/view separated: hooks/ for data, components/ for UI, pages compose both
- Types in src/types/ (one interface per file)
- Auth: Zustand store + localStorage tokens + cookie presence flag for proxy
- API layer: axios client with JWT auto-refresh

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 20:35:22 +03:00

16 lines
410 B
TypeScript

import { apiClient } from "./client";
import { UserOut } from "@/types/user";
export type { UserOut };
export const usersApi = {
list: () =>
apiClient.get<UserOut[]>("/users").then((r) => r.data),
approve: (id: string) =>
apiClient.patch<UserOut>(`/users/${id}/approve`).then((r) => r.data),
reject: (id: string) =>
apiClient.patch<UserOut>(`/users/${id}/reject`).then((r) => r.data),
};