Spaces:
Runtime error
Runtime error
Greg
Claude Opus 4.7 (1M context)
Preparar despliegue en fly.io: monolito dockerizado + seeder demo
6aa6081 Download frontend/src/services/sectionService.ts from Talosware/talos-access: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/spaces/Talosware/talos-access/resolve/main/frontend/src/services/sectionService.ts
- Command line
-
hf download hf://spaces/Talosware/talos-access/frontend/src/services/sectionService.ts
-
curl -L -o sectionService.ts https://huggingface.co/spaces/Talosware/talos-access/resolve/main/frontend/src/services/sectionService.ts
1.08 kB
| import api from './api'; | |
| import type { Section, PaginatedResponse } from '../types'; | |
| export async function listSections(filters: { page?: number; per_page?: number; search?: string; subject_id?: number; level?: string; academic_period?: string; student_name?: string; teacher_name?: string } = {}): Promise<PaginatedResponse<Section>> { | |
| const params = new URLSearchParams(); | |
| Object.entries(filters).forEach(([k, v]) => { if (v !== undefined && v !== '') params.set(k, String(v)); }); | |
| const { data } = await api.get(`/sections?${params}`); | |
| return data; | |
| } | |
| export async function createSection(payload: { name: string; subject_ids?: number[]; academic_period?: string; max_students?: number }): Promise<Section> { | |
| const { data } = await api.post('/sections', payload); | |
| return data; | |
| } | |
| export async function updateSection(id: number, payload: Partial<Section>): Promise<Section> { | |
| const { data } = await api.put(`/sections/${id}`, payload); | |
| return data; | |
| } | |
| export async function deleteSection(id: number): Promise<void> { | |
| await api.delete(`/sections/${id}`); | |
| } | |