1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-27 09:09:43 +02:00

nuxt init

This commit is contained in:
hay-kot 2021-07-31 14:00:28 -08:00
parent 79b3985a49
commit 8d3db89327
275 changed files with 13274 additions and 4003 deletions

View file

@ -0,0 +1,42 @@
import { apiReq } from "./api-utils";
import i18n from "@/i18n.js";
import { API_ROUTES } from "./apiRoutes";
export const themeAPI = {
async requestAll() {
let response = await apiReq.get(API_ROUTES.themes);
return response.data;
},
async requestByName(name) {
let response = await apiReq.get(API_ROUTES.themesId(name));
return response.data;
},
async create(postBody) {
return await apiReq.post(
API_ROUTES.themesCreate,
postBody,
() => i18n.t("settings.theme.error-creating-theme-see-log-file"),
() => i18n.t("settings.theme.theme-saved")
);
},
update(data) {
return apiReq.put(
API_ROUTES.themesId(data.id),
data,
() => i18n.t("settings.theme.error-updating-theme"),
() => i18n.t("settings.theme.theme-updated")
);
},
delete(id) {
return apiReq.delete(
API_ROUTES.themesId(id),
null,
() => i18n.t("settings.theme.error-deleting-theme"),
() => i18n.t("settings.theme.theme-deleted")
);
},
};