summaryrefslogtreecommitdiff
path: root/app/client/api/crud.fetch.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/client/api/crud.fetch.js')
-rw-r--r--app/client/api/crud.fetch.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/client/api/crud.fetch.js b/app/client/api/crud.fetch.js
index a160175..716ab3e 100644
--- a/app/client/api/crud.fetch.js
+++ b/app/client/api/crud.fetch.js
@@ -10,7 +10,7 @@ export function crud_fetch(type, tag) {
},
show: id => {
- return fetch(uri + id)
+ return fetch(uri + id, _get_headers(), _get_headers())
.then(req => req.json())
.catch(error)
},
@@ -45,6 +45,7 @@ function _get_url(_url, data) {
function _get_headers() {
return {
method: 'GET',
+ credentials: 'same-origin',
headers: {
'Accept': 'application/json',
},
@@ -54,6 +55,7 @@ export function post(data) {
return {
method: 'POST',
body: JSON.stringify(data),
+ credentials: 'same-origin',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
@@ -64,6 +66,7 @@ export function postBody(data) {
return {
method: 'POST',
body: data,
+ credentials: 'same-origin',
headers: {
'Accept': 'application/json',
},
@@ -73,6 +76,7 @@ export function put(data) {
return {
method: 'PUT',
body: JSON.stringify(data),
+ credentials: 'same-origin',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
@@ -83,6 +87,7 @@ export function destroy(data) {
return {
method: 'DELETE',
body: JSON.stringify(data),
+ credentials: 'same-origin',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'