mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-11-26 05:34:21 -05:00
feature/mealplanner-rewrite (#417)
* multiple recipes per day * fix update * meal-planner rewrite * disable meal-tests * spacing Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
77
frontend/src/api/apiRoutes.js
Normal file
77
frontend/src/api/apiRoutes.js
Normal file
@@ -0,0 +1,77 @@
|
||||
// This Content is Auto Generated
|
||||
const prefix = '/api'
|
||||
export const API_ROUTES = {
|
||||
aboutEvents: "/api/about/events",
|
||||
aboutEventsNotifications: "/api/about/events/notifications",
|
||||
aboutEventsNotificationsTest: "/api/about/events/notifications/test",
|
||||
authRefresh: "/api/auth/refresh",
|
||||
authToken: "/api/auth/token",
|
||||
authTokenLong: "/api/auth/token/long",
|
||||
backupsAvailable: "/api/backups/available",
|
||||
backupsExportDatabase: "/api/backups/export/database",
|
||||
backupsUpload: "/api/backups/upload",
|
||||
categories: "/api/categories",
|
||||
categoriesEmpty: "/api/categories/empty",
|
||||
debug: "/api/debug",
|
||||
debugLastRecipeJson: "/api/debug/last-recipe-json",
|
||||
debugLog: "/api/debug/log",
|
||||
debugStatistics: "/api/debug/statistics",
|
||||
debugVersion: "/api/debug/version",
|
||||
groups: "/api/groups",
|
||||
groupsSelf: "/api/groups/self",
|
||||
mealPlansAll: "/api/meal-plans/all",
|
||||
mealPlansCreate: "/api/meal-plans/create",
|
||||
mealPlansThisWeek: "/api/meal-plans/this-week",
|
||||
mealPlansToday: "/api/meal-plans/today",
|
||||
mealPlansTodayImage: "/api/meal-plans/today/image",
|
||||
migrations: "/api/migrations",
|
||||
recipesCategory: "/api/recipes/category",
|
||||
recipesCreate: "/api/recipes/create",
|
||||
recipesCreateUrl: "/api/recipes/create-url",
|
||||
recipesSummary: "/api/recipes/summary",
|
||||
recipesSummaryUncategorized: "/api/recipes/summary/uncategorized",
|
||||
recipesSummaryUntagged: "/api/recipes/summary/untagged",
|
||||
recipesTag: "/api/recipes/tag",
|
||||
shoppingLists: "/api/shopping-lists",
|
||||
siteSettings: "/api/site-settings",
|
||||
siteSettingsCustomPages: "/api/site-settings/custom-pages",
|
||||
siteSettingsWebhooksTest: "/api/site-settings/webhooks/test",
|
||||
tags: "/api/tags",
|
||||
tagsEmpty: "/api/tags/empty",
|
||||
themes: "/api/themes",
|
||||
themesCreate: "/api/themes/create",
|
||||
users: "/api/users",
|
||||
usersApiTokens: "/api/users-tokens",
|
||||
usersSelf: "/api/users/self",
|
||||
usersSignUps: "/api/users/sign-ups",
|
||||
utilsDownload: "/api/utils/download",
|
||||
|
||||
aboutEventsId: (id) => `${prefix}/about/events/${id}`,
|
||||
aboutEventsNotificationsId: (id) => `${prefix}/about/events/notifications/${id}`,
|
||||
backupsFileNameDelete: (file_name) => `${prefix}/backups/${file_name}/delete`,
|
||||
backupsFileNameDownload: (file_name) => `${prefix}/backups/${file_name}/download`,
|
||||
backupsFileNameImport: (file_name) => `${prefix}/backups/${file_name}/import`,
|
||||
categoriesCategory: (category) => `${prefix}/categories/${category}`,
|
||||
debugLogNum: (num) => `${prefix}/debug/log/${num}`,
|
||||
groupsId: (id) => `${prefix}/groups/${id}`,
|
||||
mealPlansIdShoppingList: (id) => `${prefix}/meal-plans/${id}/shopping-list`,
|
||||
mealPlansPlanId: (plan_id) => `${prefix}/meal-plans/${plan_id}`,
|
||||
mediaRecipesRecipeSlugAssetsFileName: (recipe_slug, file_name) => `${prefix}/media/recipes/${recipe_slug}/assets/${file_name}`,
|
||||
mediaRecipesRecipeSlugImagesFileName: (recipe_slug, file_name) => `${prefix}/media/recipes/${recipe_slug}/images/${file_name}`,
|
||||
migrationsImportTypeFileNameDelete: (import_type, file_name) => `${prefix}/migrations/${import_type}/${file_name}/delete`,
|
||||
migrationsImportTypeFileNameImport: (import_type, file_name) => `${prefix}/migrations/${import_type}/${file_name}/import`,
|
||||
migrationsImportTypeUpload: (import_type) => `${prefix}/migrations/${import_type}/upload`,
|
||||
recipesRecipeSlug: (recipe_slug) => `${prefix}/recipes/${recipe_slug}`,
|
||||
recipesRecipeSlugAssets: (recipe_slug) => `${prefix}/recipes/${recipe_slug}/assets`,
|
||||
recipesRecipeSlugImage: (recipe_slug) => `${prefix}/recipes/${recipe_slug}/image`,
|
||||
shoppingListsId: (id) => `${prefix}/shopping-lists/${id}`,
|
||||
siteSettingsCustomPagesId: (id) => `${prefix}/site-settings/custom-pages/${id}`,
|
||||
tagsTag: (tag) => `${prefix}/tags/${tag}`,
|
||||
themesId: (id) => `${prefix}/themes/${id}`,
|
||||
usersApiTokensTokenId: (token_id) => `${prefix}/users-tokens/${token_id}`,
|
||||
usersId: (id) => `${prefix}/users/${id}`,
|
||||
usersIdImage: (id) => `${prefix}/users/${id}/image`,
|
||||
usersIdPassword: (id) => `${prefix}/users/${id}/password`,
|
||||
usersIdResetPassword: (id) => `${prefix}/users/${id}/reset-password`,
|
||||
usersSignUpsToken: (token) => `${prefix}/users/sign-ups/${token}`,
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import { signupAPI } from "./signUps";
|
||||
import { groupAPI } from "./groups";
|
||||
import { siteSettingsAPI } from "./siteSettings";
|
||||
import { aboutAPI } from "./about";
|
||||
import { shoppingListsAPI } from "./shoppingLists";
|
||||
|
||||
/**
|
||||
* The main object namespace for interacting with the backend database
|
||||
@@ -32,4 +33,5 @@ export const api = {
|
||||
signUps: signupAPI,
|
||||
groups: groupAPI,
|
||||
about: aboutAPI,
|
||||
shoppingLists: shoppingListsAPI,
|
||||
};
|
||||
|
||||
33
frontend/src/api/shoppingLists.js
Normal file
33
frontend/src/api/shoppingLists.js
Normal file
@@ -0,0 +1,33 @@
|
||||
// This Content is Auto Generated
|
||||
import { API_ROUTES } from "./apiRoutes";
|
||||
import { apiReq } from "./api-utils";
|
||||
|
||||
export const shoppingListsAPI = {
|
||||
/** Create Shopping List in the Database
|
||||
*/
|
||||
async createShoppingList(data) {
|
||||
const response = await apiReq.post(API_ROUTES.shoppingLists, data);
|
||||
return response.data;
|
||||
},
|
||||
/** Get Shopping List from the Database
|
||||
* @param id
|
||||
*/
|
||||
async getShoppingList(id) {
|
||||
const response = await apiReq.get(API_ROUTES.shoppingListsId(id));
|
||||
return response.data;
|
||||
},
|
||||
/** Update Shopping List in the Database
|
||||
* @param id
|
||||
*/
|
||||
async updateShoppingList(id, data) {
|
||||
const response = await apiReq.put(API_ROUTES.shoppingListsId(id), data);
|
||||
return response.data;
|
||||
},
|
||||
/** Delete Shopping List from the Database
|
||||
* @param id
|
||||
*/
|
||||
async deleteShoppingList(id) {
|
||||
const response = await apiReq.delete(API_ROUTES.shoppingListsId(id));
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user