1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-05 05:25:26 +02:00

Docs/v0.5.0 second pass (#496)

* update docs

* use auto-gen routes

* dumb deps

* remove whitespace

* github action to build dev docs container

* no cache

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden 2021-06-11 21:57:59 -08:00 committed by GitHub
parent 06ed377c00
commit e34079673c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 555 additions and 508 deletions

View file

@ -1,31 +1,21 @@
import { baseURL } from "./api-utils";
import { apiReq } from "./api-utils";
import i18n from "@/i18n.js";
const prefix = baseURL + "themes";
const settingsURLs = {
allThemes: `${baseURL}themes`,
specificTheme: id => `${prefix}/${id}`,
createTheme: `${prefix}/create`,
updateTheme: id => `${prefix}/${id}`,
deleteTheme: id => `${prefix}/${id}`,
};
import { API_ROUTES } from "./apiRoutes";
export const themeAPI = {
async requestAll() {
let response = await apiReq.get(settingsURLs.allThemes);
let response = await apiReq.get(API_ROUTES.themes);
return response.data;
},
async requestByName(name) {
let response = await apiReq.get(settingsURLs.specificTheme(name));
let response = await apiReq.get(API_ROUTES.themesId(name));
return response.data;
},
async create(postBody) {
return await apiReq.post(
settingsURLs.createTheme,
API_ROUTES.themesCreate,
postBody,
() => i18n.t("settings.theme.error-creating-theme-see-log-file"),
() => i18n.t("settings.theme.theme-saved")
@ -34,7 +24,7 @@ export const themeAPI = {
update(data) {
return apiReq.put(
settingsURLs.updateTheme(data.id),
API_ROUTES.themesId(data.id),
data,
() => i18n.t("settings.theme.error-updating-theme"),
() => i18n.t("settings.theme.theme-updated")
@ -43,7 +33,7 @@ export const themeAPI = {
delete(id) {
return apiReq.delete(
settingsURLs.deleteTheme(id),
API_ROUTES.themesId(id),
null,
() => i18n.t("settings.theme.error-deleting-theme"),
() => i18n.t("settings.theme.theme-deleted")