mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-17 07:59:41 +02:00
The Clock app source is preserved in apps-archived/ for reference. This directory is excluded from the pnpm workspace. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
15 lines
584 B
TypeScript
15 lines
584 B
TypeScript
/**
|
|
* Alarms API - Direct API calls for alarms
|
|
*/
|
|
|
|
import { api } from './client';
|
|
import type { Alarm, CreateAlarmInput, UpdateAlarmInput } from '@clock/shared';
|
|
|
|
export const alarmsApi = {
|
|
getAll: () => api.get<Alarm[]>('/alarms'),
|
|
getById: (id: string) => api.get<Alarm>(`/alarms/${id}`),
|
|
create: (input: CreateAlarmInput) => api.post<Alarm>('/alarms', input),
|
|
update: (id: string, input: UpdateAlarmInput) => api.patch<Alarm>(`/alarms/${id}`, input),
|
|
delete: (id: string) => api.delete(`/alarms/${id}`),
|
|
toggle: (id: string) => api.post<Alarm>(`/alarms/${id}/toggle`),
|
|
};
|