mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-23 07:09:41 +02:00
feat: add delete option to three dots menu (#4842)
Co-authored-by: John Corser <xss@amazon.com> Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
parent
b5dfaf12f1
commit
6097ff2a34
2 changed files with 6 additions and 3 deletions
|
@ -47,7 +47,6 @@
|
||||||
:recipe-id="recipe.id"
|
:recipe-id="recipe.id"
|
||||||
:recipe-scale="recipeScale"
|
:recipe-scale="recipeScale"
|
||||||
:use-items="{
|
:use-items="{
|
||||||
delete: false,
|
|
||||||
edit: false,
|
edit: false,
|
||||||
download: loggedIn,
|
download: loggedIn,
|
||||||
duplicate: loggedIn,
|
duplicate: loggedIn,
|
||||||
|
@ -57,6 +56,7 @@
|
||||||
printPreferences: true,
|
printPreferences: true,
|
||||||
share: loggedIn,
|
share: loggedIn,
|
||||||
recipeActions: true,
|
recipeActions: true,
|
||||||
|
delete: loggedIn,
|
||||||
}"
|
}"
|
||||||
class="ml-1"
|
class="ml-1"
|
||||||
@print="$emit('print')"
|
@print="$emit('print')"
|
||||||
|
|
|
@ -276,7 +276,7 @@ export default defineComponent({
|
||||||
delete: {
|
delete: {
|
||||||
title: i18n.tc("general.delete"),
|
title: i18n.tc("general.delete"),
|
||||||
icon: $globals.icons.delete,
|
icon: $globals.icons.delete,
|
||||||
color: "error",
|
color: undefined,
|
||||||
event: "delete",
|
event: "delete",
|
||||||
isPublic: false,
|
isPublic: false,
|
||||||
},
|
},
|
||||||
|
@ -383,7 +383,10 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteRecipe() {
|
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);
|
context.emit("delete", props.slug);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue