Skip to content

Commit

Permalink
feat: add delete option to three dots menu
Browse files Browse the repository at this point in the history
  • Loading branch information
John Corser committed Jan 15, 2025
1 parent 203218a commit bcd22d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/components/Domain/Recipe/RecipeActionMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
:recipe-id="recipe.id"
:recipe-scale="recipeScale"
:use-items="{
delete: false,
edit: false,
download: loggedIn,
duplicate: loggedIn,
Expand All @@ -57,6 +56,7 @@
printPreferences: true,
share: loggedIn,
recipeActions: true,
delete: loggedIn,
}"
class="ml-1"
@print="$emit('print')"
Expand Down
7 changes: 5 additions & 2 deletions frontend/components/Domain/Recipe/RecipeContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export default defineComponent({
delete: {
title: i18n.tc("general.delete"),
icon: $globals.icons.delete,
color: "error",
color: undefined,
event: "delete",
isPublic: false,
},
Expand Down Expand Up @@ -383,7 +383,10 @@ export default defineComponent({
}
async function deleteRecipe() {
await api.recipes.deleteOne(props.slug);
const { data } = await api.recipes.deleteOne(props.slug);
if (data?.slug) {
router.push(`/g/${groupSlug.value}`);
}
context.emit("delete", props.slug);
}
Expand Down

0 comments on commit bcd22d4

Please sign in to comment.