mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-17 14:09:40 +02:00
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>
33 lines
731 B
TypeScript
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}`),
|
|
};
|