diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-09-17 02:25:36 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-09-17 02:25:36 +0200 |
| commit | 4c18946614657a9f8955408e514172a74eacc28e (patch) | |
| tree | 1fa92e5e7f798203d40e846bd8577b0459af1fcd /app/client/api/crud.fetch.js | |
| parent | 7ef59901e08b6610f134c696876695cf52061f48 (diff) | |
logging i
Diffstat (limited to 'app/client/api/crud.fetch.js')
| -rw-r--r-- | app/client/api/crud.fetch.js | 7 |
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' |
