mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-11-05 03:33:19 -05:00
feature/recipe-patch-improvements (#382)
* automated docs update * recipe rating component * recipe partial updates - closes #25 * use Vue.delete to update store * format * arrow functions * fix tests * format * initial context menu * localize * add confirmation dialog * context menu * fix bare exception * update line length * format all file with prettier * update changelog * download as json * update python dependencies * update javascript dependencies Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { baseURL } from "./api-utils";
|
||||
import { apiReq } from "./api-utils";
|
||||
import { store } from "@/store";
|
||||
import i18n from '@/i18n.js';
|
||||
import i18n from "@/i18n.js";
|
||||
|
||||
const settingsBase = baseURL + "site-settings";
|
||||
|
||||
@@ -21,12 +21,12 @@ export const siteSettingsAPI = {
|
||||
|
||||
async update(body) {
|
||||
const response = await apiReq.put(
|
||||
settingsURLs.updateSiteSettings,
|
||||
settingsURLs.updateSiteSettings,
|
||||
body,
|
||||
function() { return i18n.t('settings.settings-update-failed'); },
|
||||
function() { return i18n.t('settings.settings-updated'); }
|
||||
() => i18n.t("settings.settings-update-failed"),
|
||||
() => i18n.t("settings.settings-updated")
|
||||
);
|
||||
if(response) {
|
||||
if (response) {
|
||||
store.dispatch("requestSiteSettings");
|
||||
}
|
||||
return response;
|
||||
@@ -44,10 +44,10 @@ export const siteSettingsAPI = {
|
||||
|
||||
createPage(body) {
|
||||
return apiReq.post(
|
||||
settingsURLs.customPages,
|
||||
settingsURLs.customPages,
|
||||
body,
|
||||
function() { return i18n.t('page.page-creation-failed'); },
|
||||
function() { return i18n.t('page.new-page-created'); }
|
||||
() => i18n.t("page.page-creation-failed"),
|
||||
() => i18n.t("page.new-page-created")
|
||||
);
|
||||
},
|
||||
|
||||
@@ -55,25 +55,26 @@ export const siteSettingsAPI = {
|
||||
return await apiReq.delete(
|
||||
settingsURLs.customPage(id),
|
||||
null,
|
||||
function() { return i18n.t('page.page-deletion-failed'); },
|
||||
function() { return i18n.t('page.page-deleted'); });
|
||||
() => i18n.t("page.page-deletion-failed"),
|
||||
() => i18n.t("page.page-deleted")
|
||||
);
|
||||
},
|
||||
|
||||
updatePage(body) {
|
||||
return apiReq.put(
|
||||
settingsURLs.customPage(body.id),
|
||||
body,
|
||||
function() { return i18n.t('page.page-update-failed'); },
|
||||
function() { return i18n.t('page.page-updated'); }
|
||||
() => i18n.t("page.page-update-failed"),
|
||||
() => i18n.t("page.page-updated")
|
||||
);
|
||||
},
|
||||
|
||||
async updateAllPages(allPages) {
|
||||
let response = await apiReq.put(
|
||||
settingsURLs.customPages,
|
||||
settingsURLs.customPages,
|
||||
allPages,
|
||||
function() { return i18n.t('page.pages-update-failed'); },
|
||||
function() { return i18n.t('page.pages-updated'); }
|
||||
() => i18n.t("page.pages-update-failed"),
|
||||
() => i18n.t("page.pages-updated")
|
||||
);
|
||||
return response;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user