feat: Add delete button to recipe image modal #4708
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this
What this PR does / why we need it:
Currently there is no way to delete an image for a recipe once it has been uploaded (although uploading/scraping a new image will replace the current image). This PR adds a way to remove an image that has been uploaded or scraped.
Files changed:
frontend/components/Domain/Recipe/RecipeImageUploadBtn.vue
Increase the width of the modal and add the delete button emit a delete event.
frontend/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageEditorToolbar.vue
Call the API to delete.
frontend/lib/api/user/recipes/recipe.ts
Handle response.
mealie/repos/repository_recipes.py
Update the repository.
mealie/routes/recipe/recipe_crud_routes.py
Add new CRUD route to add delete functionality.
mealie/services/recipe/recipe_data_service.py
Add data service function to delete the image.
Before:
After:
Which issue(s) this PR fixes:
Fixes #4595
Special notes for your reviewer:
This is my first ever PR on a public project! Sorry for all the errors! Please let me know where I can do better!
Testing
Manual testing through the UI