From cd82d08dbc8e039e28bebf0e507f0a0d78ff4056 Mon Sep 17 00:00:00 2001 From: igoradamenko Date: Sat, 10 Mar 2018 23:06:47 +0300 Subject: [PATCH] Revert "fix using unfetch api" This reverts commit 10d9c1a --- web/app/common/api.js | 3 +-- web/app/common/fetcher.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/web/app/common/api.js b/web/app/common/api.js index 0b86f93f..004e71de 100644 --- a/web/app/common/api.js +++ b/web/app/common/api.js @@ -2,7 +2,7 @@ import { siteId, url } from './settings'; import fetcher from './fetcher' -/* user */ +/* common */ export const logOut = () => fetcher.get({ url: `/auth/logout`, overriddenApiBase: '' }); @@ -36,7 +36,6 @@ export const getUser = () => fetcher.get({ }); /* admin */ - export const pin = ({ id, url }) => fetcher.put({ url: `/admin/pin/${id}?url=${url}&pin=1`, withCredentials: true, diff --git a/web/app/common/fetcher.js b/web/app/common/fetcher.js index 4f074713..6075db30 100644 --- a/web/app/common/fetcher.js +++ b/web/app/common/fetcher.js @@ -42,7 +42,7 @@ methods.forEach(method => { }; if (Object.keys(body).length) { - parameters.body = JSON.stringify(body); + parameters.data = body; } let requestUrl = `${basename}${url}`;