import { apiFetch } from './client'
import type { Note } from './types'

export function fetchNotes(recipeId: string) {
  return apiFetch<Note[]>(`/recipes/${recipeId}/notes`)
}

export function createNote(recipeId: string, content: string) {
  return apiFetch<Note>(`/recipes/${recipeId}/notes`, {
    method: 'POST',
    body: JSON.stringify({ content }),
  })
}

export function deleteNote(noteId: string) {
  return apiFetch<{ ok: boolean }>(`/notes/${noteId}`, { method: 'DELETE' })
}
