()
| 3 | |
| 4 | export const configApi = { |
| 5 | async load(): Promise<AppConfig> { |
| 6 | const res = await fetch('/api/config') |
| 7 | if (!res.ok) throw new Error('Failed to load config') |
| 8 | return res.json() |
| 9 | }, |
| 10 | |
| 11 | async updateSection(section: string, data: unknown): Promise<unknown> { |
| 12 | const res = await fetch(`/api/config/${section}`, { |