1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-19 05:09:40 +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:
John Corser 2025-01-15 11:49:21 -05:00 committed by GitHub
parent b5dfaf12f1
commit 6097ff2a34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View file

@ -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,
},
@ -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);
}