Spaces:
Running
Running
Download frontend/src/features/workspace/services/workspaceService.ts from Shadowfilebot/Bot: direct link, hf CLI and curl.
- Browser
- Download file 724 Bytes
-
https://huggingface.co/spaces/Shadowfilebot/Bot/resolve/main/frontend/src/features/workspace/services/workspaceService.ts
- Command line
-
hf download hf://spaces/Shadowfilebot/Bot/frontend/src/features/workspace/services/workspaceService.ts
-
curl -L -o workspaceService.ts https://huggingface.co/spaces/Shadowfilebot/Bot/resolve/main/frontend/src/features/workspace/services/workspaceService.ts
724 Bytes
| import { requestJson } from '@/shared/lib/httpClient'; | |
| import { WorkspaceOwnerOption, Zone } from '../types/workspaceTypes'; | |
| export const workspaceService = { | |
| listZones: () => requestJson<Zone[]>('/api/zones'), | |
| createZone: (name: string, description: string, ownerId?: string) => { | |
| const form = new FormData(); | |
| form.append('name', name); | |
| form.append('description', description); | |
| if (ownerId) form.append('owner_id', ownerId); | |
| return requestJson('/api/zones', { method: 'POST', body: form }); | |
| }, | |
| deleteZone: (name: string) => | |
| requestJson(`/api/zones/${encodeURIComponent(name)}`, { method: 'DELETE' }), | |
| listOwnerOptions: () => requestJson<WorkspaceOwnerOption[]>('/api/admin/users'), | |
| }; | |