- 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>
16 lines
410 B
TypeScript
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),
|
|
};
|