Plany: wznowienie ukonczonego/porzuconego planu (poprawki bez tworzenia nowego, blokada przy innym aktywnym)
This commit is contained in:
@@ -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' });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user