mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-11-30 15:44:37 -05:00
Refactor/backend routers (#388)
* update router * update caddy file * setup depends in docker-fole * make changes for serving on subpath * set dev config * fix router signups * consolidate links * backup-functionality to dashboard * new user card * consolidate theme into profile * fix theme tests * fix pg tests * fix pg tests * remove unused import * mobile margin Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
@@ -135,14 +135,18 @@ export const recipeAPI = {
|
||||
},
|
||||
|
||||
recipeImage(recipeSlug) {
|
||||
return `/api/recipes/media/${recipeSlug}/images/original.webp`;
|
||||
return `/api/media/recipes/${recipeSlug}/images/original.webp`;
|
||||
},
|
||||
|
||||
recipeSmallImage(recipeSlug) {
|
||||
return `/api/recipes/media/${recipeSlug}/images/min-original.webp`;
|
||||
return `/api/media/recipes/${recipeSlug}/images/min-original.webp`;
|
||||
},
|
||||
|
||||
recipeTinyImage(recipeSlug) {
|
||||
return `/api/recipes/media/${recipeSlug}/images/tiny-original.webp`;
|
||||
return `/api/media/recipes/${recipeSlug}/images/tiny-original.webp`;
|
||||
},
|
||||
|
||||
recipeAssetPath(recipeSlug, assetName) {
|
||||
return `api/media/recipes/${recipeSlug}/assets/${assetName}`;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -6,10 +6,10 @@ const prefix = baseURL + "themes";
|
||||
|
||||
const settingsURLs = {
|
||||
allThemes: `${baseURL}themes`,
|
||||
specificTheme: themeName => `${prefix}/${themeName}`,
|
||||
specificTheme: id => `${prefix}/${id}`,
|
||||
createTheme: `${prefix}/create`,
|
||||
updateTheme: themeName => `${prefix}/${themeName}`,
|
||||
deleteTheme: themeName => `${prefix}/${themeName}`,
|
||||
updateTheme: id => `${prefix}/${id}`,
|
||||
deleteTheme: id => `${prefix}/${id}`,
|
||||
};
|
||||
|
||||
export const themeAPI = {
|
||||
@@ -32,22 +32,18 @@ export const themeAPI = {
|
||||
);
|
||||
},
|
||||
|
||||
update(themeName, colors) {
|
||||
const body = {
|
||||
name: themeName,
|
||||
colors: colors,
|
||||
};
|
||||
update(data) {
|
||||
return apiReq.put(
|
||||
settingsURLs.updateTheme(themeName),
|
||||
body,
|
||||
settingsURLs.updateTheme(data.id),
|
||||
data,
|
||||
() => i18n.t("settings.theme.error-updating-theme"),
|
||||
() => i18n.t("settings.theme.theme-updated")
|
||||
);
|
||||
},
|
||||
|
||||
delete(themeName) {
|
||||
delete(id) {
|
||||
return apiReq.delete(
|
||||
settingsURLs.deleteTheme(themeName),
|
||||
settingsURLs.deleteTheme(id),
|
||||
null,
|
||||
() => i18n.t("settings.theme.error-deleting-theme"),
|
||||
() => i18n.t("settings.theme.theme-deleted")
|
||||
|
||||
Reference in New Issue
Block a user