Files
gengitkan/client/src/util/api.js
2019-12-05 12:29:17 +01:00

24 lines
386 B
JavaScript

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