fix using unfetch api

This commit is contained in:
igoradamenko
2018-03-10 19:48:59 +03:00
parent b020ef22a0
commit 10d9c1ae41
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -2,7 +2,7 @@ import { siteId, url } from './settings';
import fetcher from './fetcher' import fetcher from './fetcher'
/* common */ /* user */
export const logOut = () => fetcher.get({ url: `/auth/logout`, overriddenApiBase: '' }); export const logOut = () => fetcher.get({ url: `/auth/logout`, overriddenApiBase: '' });
@@ -36,6 +36,7 @@ export const getUser = () => fetcher.get({
}); });
/* admin */ /* admin */
export const pin = ({ id, url }) => fetcher.put({ export const pin = ({ id, url }) => fetcher.put({
url: `/admin/pin/${id}?url=${url}&pin=1`, url: `/admin/pin/${id}?url=${url}&pin=1`,
withCredentials: true, withCredentials: true,
+1 -1
View File
@@ -42,7 +42,7 @@ methods.forEach(method => {
}; };
if (Object.keys(body).length) { if (Object.keys(body).length) {
parameters.data = body; parameters.body = JSON.stringify(body);
} }
let requestUrl = `${basename}${url}`; let requestUrl = `${basename}${url}`;