From 7f59ccb050c0fb787aab2d0cdb82bc35b86edd7f Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Thu, 17 Sep 2020 03:29:59 +0300 Subject: [PATCH] Fix updating instance docs --- src/api/settings.js | 2 +- src/store/modules/settings.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api/settings.js b/src/api/settings.js index b79b602e..77651ec0 100644 --- a/src/api/settings.js +++ b/src/api/settings.js @@ -43,7 +43,7 @@ export async function updateInstanceDocument(name, formData, authHost, token) { return fetch(url, { body: formData, - method: 'patch', + method: 'PATCH', headers: authHeaders(token) }) .then((data) => data.json()) diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index eaf9bda4..f6ea4873 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -132,7 +132,8 @@ const settings = { }, async UpdateInstanceDocs({ getters }, { name, content }) { const formData = new FormData() - formData.append('file', content) + const blob = new Blob([content], { type: 'text/html' }) + formData.append('file', blob) await updateInstanceDocument(name, formData, getters.authHost, getters.token) }, UpdateSettings({ commit }, { group, key, input, value, type }) {