From 4c18946614657a9f8955408e514172a74eacc28e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 17 Sep 2018 02:25:36 +0200 Subject: logging i --- app/client/api/crud.fetch.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/client/api/crud.fetch.js') 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' -- cgit v1.2.3-70-g09d2