1
0
Fork 0
mirror of synced 2024-09-15 00:38:01 +12:00
budibase/packages/builder/src/builderStore/api.js

17 lines
391 B
JavaScript
Raw Normal View History

2019-09-09 16:23:41 +12:00
const apiCall = (method) => (url, body) =>
2019-07-28 19:03:11 +12:00
fetch(url, {
method: method,
headers: {
'Content-Type': 'application/json',
},
body: body && JSON.stringify(body),
2019-08-20 08:18:23 +12:00
});
2019-07-28 19:03:11 +12:00
2019-09-09 16:23:41 +12:00
const post = apiCall("POST");
const get = apiCall("GET");
const patch = apiCall("PATCH");
const del = apiCall("DELETE");
2019-07-28 19:03:11 +12:00
export default {
post, get, patch, delete:del
};