Plany: wznowienie ukonczonego/porzuconego planu (poprawki bez tworzenia nowego, blokada przy innym aktywnym)

This commit is contained in:
Tilumca
2026-10-15 01:42:26 +02:00
parent 8044b0a4bd
commit 27a1507e50
16 changed files with 649 additions and 31 deletions

View File

@@ -161,14 +161,16 @@ export interface GymAddressBody {
countryCode?: string | null;
}
export function createGym(body: {
name: string;
location?: string | null;
availability?: Availability | null;
capacity?: number | null;
kind?: GymKind;
isPrivate?: boolean;
} & GymAddressBody) {
export function createGym(
body: {
name: string;
location?: string | null;
availability?: Availability | null;
capacity?: number | null;
kind?: GymKind;
isPrivate?: boolean;
} & GymAddressBody,
) {
return api<{ gym: UserGym }>('/gyms', { method: 'POST', body });
}
@@ -478,6 +480,10 @@ export function completePlan(id: string) {
return api(`/plans/${id}/complete`, { method: 'POST' });
}
export function reopenPlan(id: string) {
return api(`/plans/${id}/reopen`, { method: 'POST' });
}
// ---------- sessions ----------
export function useSession(id: string) {
return useQuery({
@@ -803,3 +809,7 @@ export function abandonTraineePlan(userId: string, planId: string) {
export function completeTraineePlan(userId: string, planId: string) {
return api(`/trainer/trainees/${userId}/plans/${planId}/complete`, { method: 'POST' });
}
export function reopenTraineePlan(userId: string, planId: string) {
return api(`/trainer/trainees/${userId}/plans/${planId}/reopen`, { method: 'POST' });
}