aboutsummaryrefslogtreecommitdiffstats
path: root/src/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/api')
-rw-r--r--src/api/server/ServerApi.js4
-rw-r--r--src/api/utils/auth.js5
2 files changed, 4 insertions, 5 deletions
diff --git a/src/api/server/ServerApi.js b/src/api/server/ServerApi.js
index 75d18f234..8fdaed363 100644
--- a/src/api/server/ServerApi.js
+++ b/src/api/server/ServerApi.js
@@ -183,9 +183,7 @@ export default class ServerApi {
183 async createService(recipeId, data) { 183 async createService(recipeId, data) {
184 const request = await sendAuthRequest(`${apiBase()}/service`, { 184 const request = await sendAuthRequest(`${apiBase()}/service`, {
185 method: 'POST', 185 method: 'POST',
186 body: JSON.stringify(Object.assign({ 186 body: JSON.stringify({ recipeId, ...data }),
187 recipeId,
188 }, data)),
189 }); 187 });
190 if (!request.ok) { 188 if (!request.ok) {
191 throw request; 189 throw request;
diff --git a/src/api/utils/auth.js b/src/api/utils/auth.js
index 5952cfe11..9f718f171 100644
--- a/src/api/utils/auth.js
+++ b/src/api/utils/auth.js
@@ -4,14 +4,15 @@ import localStorage from 'mobx-localstorage';
4export const prepareAuthRequest = (options = { method: 'GET' }, auth = true) => { 4export const prepareAuthRequest = (options = { method: 'GET' }, auth = true) => {
5 const request = Object.assign(options, { 5 const request = Object.assign(options, {
6 mode: 'cors', 6 mode: 'cors',
7 headers: Object.assign({ 7 headers: {
8 'Content-Type': 'application/json', 8 'Content-Type': 'application/json',
9 'X-Franz-Source': 'desktop', 9 'X-Franz-Source': 'desktop',
10 'X-Franz-Version': app.getVersion(), 10 'X-Franz-Version': app.getVersion(),
11 'X-Franz-platform': process.platform, 11 'X-Franz-platform': process.platform,
12 'X-Franz-Timezone-Offset': new Date().getTimezoneOffset(), 12 'X-Franz-Timezone-Offset': new Date().getTimezoneOffset(),
13 'X-Franz-System-Locale': app.getLocale(), 13 'X-Franz-System-Locale': app.getLocale(),
14 }, options.headers), 14 ...options.headers,
15 },
15 }); 16 });
16 17
17 if (auth) { 18 if (auth) {