Skip to content

Commit 9394929

Browse files
authored
Merge pull request #55 from balajidharma/2.x-Changes
Fixed delete issue
2 parents 5c5e2dc + 155ab39 commit 9394929

File tree

4 files changed

+21
-23
lines changed

4 files changed

+21
-23
lines changed

resources/js/Components/Admin/CategoryItemList.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup>
2-
import { Link } from "@inertiajs/vue3"
2+
import { useForm } from "@inertiajs/vue3"
33
import BaseButton from "@/Components/BaseButton.vue"
44
import BaseButtons from "@/Components/BaseButtons.vue"
55
import {
@@ -25,6 +25,14 @@ const props = defineProps({
2525
default: 0
2626
},
2727
})
28+
29+
const formDelete = useForm({})
30+
31+
function destroy(id) {
32+
if (confirm("Are you sure you want to delete?")) {
33+
formDelete.delete(route("admin.category.type.item.destroy", {type: props.categoryType.id, item: id}))
34+
}
35+
}
2836
</script>
2937

3038
<template>

resources/js/Components/Admin/MenuItemList.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup>
2-
import { Link } from "@inertiajs/vue3"
2+
import { useForm } from "@inertiajs/vue3"
33
import BaseButton from "@/Components/BaseButton.vue"
44
import BaseButtons from "@/Components/BaseButtons.vue"
55
import BaseIcon from '@/Components/BaseIcon.vue'
@@ -26,6 +26,15 @@ const props = defineProps({
2626
default: 0
2727
},
2828
})
29+
30+
const formDelete = useForm({})
31+
32+
function destroy(id) {
33+
if (confirm("Are you sure you want to delete?")) {
34+
formDelete.delete(route("admin.menu.item.destroy", {menu: props.menu.id, item: id}))
35+
}
36+
}
37+
2938
</script>
3039

3140
<template>
@@ -36,7 +45,6 @@ const props = defineProps({
3645
v-if="item.icon"
3746
:path="item.icon"
3847
class="flex-none"
39-
:class="activeInactiveStyle"
4048
:size="18"
4149
/>
4250
{{ item.name }}

resources/js/Pages/Admin/Category/Item/Index.vue

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup>
2-
import { Head, useForm } from "@inertiajs/vue3"
2+
import { Head } from "@inertiajs/vue3"
33
import {
44
mdiLink,
55
mdiPlus,
@@ -30,14 +30,6 @@ const props = defineProps({
3030
},
3131
})
3232
33-
const formDelete = useForm({})
34-
35-
function destroy(id) {
36-
if (confirm("Are you sure you want to delete?")) {
37-
formDelete.delete(route("admin.category.type.item.destroy", {type: props.categoryType.id, item: id}))
38-
}
39-
}
40-
4133
</script>
4234

4335
<template>

resources/js/Pages/Admin/Menu/Item/Index.vue

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<script setup>
2-
import { Head, Link, useForm } from "@inertiajs/vue3"
2+
import { Head } from "@inertiajs/vue3"
33
import {
44
mdiLink,
55
mdiPlus,
6-
mdiSquareEditOutline,
7-
mdiTrashCan,
86
mdiAlertBoxOutline,
97
mdiArrowLeftBoldOutline
108
} from "@mdi/js"
@@ -32,14 +30,6 @@ const props = defineProps({
3230
},
3331
})
3432
35-
const formDelete = useForm({})
36-
37-
function destroy(id) {
38-
if (confirm("Are you sure you want to delete?")) {
39-
formDelete.delete(route("admin.menu.item.destroy", {menu: props.menu.id, item: id}))
40-
}
41-
}
42-
4333
</script>
4434

4535
<template>

0 commit comments

Comments
 (0)