diff --git a/web/app/common/api.js b/web/app/common/api.js index 004e71de..0b86f93f 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' -/* common */ +/* user */ export const logOut = () => fetcher.get({ url: `/auth/logout`, overriddenApiBase: '' }); @@ -36,6 +36,7 @@ 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 6075db30..4f074713 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.data = body; + parameters.body = JSON.stringify(body); } let requestUrl = `${basename}${url}`;