export class APIClient { saveBoard(board) { return fetch(`/api/boards`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(board) }) .then(res => res.json()) ; } deleteBoard(id) { return fetch(`/api/boards/${id}`, { method: 'DELETE' }); } fetchBoards() { return fetch(`/api/boards`) .then(res => res.json()) ; } } export const api = new APIClient();