paperclip/ui/src/api/goals.ts

11 lines
417 B
TypeScript
Raw Normal View History

import type { Goal } from "@paperclip/shared";
import { api } from "./client";
export const goalsApi = {
list: () => api.get<Goal[]>("/goals"),
get: (id: string) => api.get<Goal>(`/goals/${id}`),
create: (data: Partial<Goal>) => api.post<Goal>("/goals", data),
update: (id: string, data: Partial<Goal>) => api.patch<Goal>(`/goals/${id}`, data),
remove: (id: string) => api.delete<Goal>(`/goals/${id}`),
};