mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 13:35:23 +02:00
feature/recipe-comments (#448)
* fix favorite color issue * db and models for comments * rename files * initial UI for comments * fix format * import / export * fixes #428 * format Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
parent
6f38fcf81b
commit
2b97af5728
22 changed files with 360 additions and 19 deletions
|
@ -1,5 +1,6 @@
|
|||
import { baseURL } from "./api-utils";
|
||||
import { API_ROUTES } from "./apiRoutes";
|
||||
import { apiReq } from "./api-utils";
|
||||
import { baseURL } from "./api-utils";
|
||||
import { store } from "../store";
|
||||
import i18n from "@/i18n.js";
|
||||
|
||||
|
@ -161,4 +162,28 @@ export const recipeAPI = {
|
|||
recipeAssetPath(recipeSlug, assetName) {
|
||||
return `api/media/recipes/${recipeSlug}/assets/${assetName}`;
|
||||
},
|
||||
|
||||
/** Create comment in the Database
|
||||
* @param slug
|
||||
*/
|
||||
async createComment(slug, data) {
|
||||
const response = await apiReq.post(API_ROUTES.recipesSlugComments(slug), data);
|
||||
return response.data;
|
||||
},
|
||||
/** Update comment in the Database
|
||||
* @param slug
|
||||
* @param id
|
||||
*/
|
||||
async updateComment(slug, id, data) {
|
||||
const response = await apiReq.put(API_ROUTES.recipesSlugCommentsId(slug, id), data);
|
||||
return response.data;
|
||||
},
|
||||
/** Delete comment from the Database
|
||||
* @param slug
|
||||
* @param id
|
||||
*/
|
||||
async deleteComment(slug, id) {
|
||||
const response = await apiReq.delete(API_ROUTES.recipesSlugCommentsId(slug, id));
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue