managarten/apps/clock/apps/web/src/lib/api/presets.ts
Till-JS 2ef457ea23 feat(clock): add complete Clock app with backend, web, and landing
Features:
- World clock with timezone support and drag & drop sorting
- Alarms with repeat days, snooze, and custom sounds
- Multiple timers with start/pause/reset controls
- Stopwatch with lap times (local only)
- Pomodoro timer with customizable intervals
- Analog and digital clock widgets
- i18n support (DE, EN, FR, ES, IT)

Stack:
- Backend: NestJS 10, Drizzle ORM, PostgreSQL (port 3017)
- Web: SvelteKit 2.x, Svelte 5 runes, Tailwind CSS 4 (port 5186)
- Landing: Astro 5.x with animated clock hero (port 4323)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 15:37:51 +01:00

33 lines
731 B
TypeScript

/**
* Presets API client
*/
import { api } from './client';
import type { Preset, CreatePresetInput, UpdatePresetInput } from '@clock/shared';
export const presetsApi = {
/**
* Get all presets for the current user
*/
getAll: () => api.get<Preset[]>('/presets'),
/**
* Get presets by type
*/
getByType: (type: 'timer' | 'pomodoro') => api.get<Preset[]>(`/presets?type=${type}`),
/**
* Create a new preset
*/
create: (data: CreatePresetInput) => api.post<Preset>('/presets', data),
/**
* Update an existing preset
*/
update: (id: string, data: UpdatePresetInput) => api.put<Preset>(`/presets/${id}`, data),
/**
* Delete a preset
*/
delete: (id: string) => api.delete<void>(`/presets/${id}`),
};