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>
This commit is contained in:
15
web/src/lib/api/users.ts
Normal file
15
web/src/lib/api/users.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
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),
|
||||
};
|
||||
Reference in New Issue
Block a user