fix bug menu is not rerender after created, updated and deleted

This commit is contained in:
Geriano
2022-07-29 20:45:27 +07:00
parent 96b732cb5f
commit 8585428659

View File

@@ -61,6 +61,7 @@ const store = () => {
onSuccess: () => {
close()
form.reset()
Inertia.get(route(route().current()))
},
onError: () => {
@@ -85,6 +86,7 @@ const update = () => {
onSuccess: () => {
close()
form.reset()
Inertia.get(route(route().current()))
},
onError: () => {
@@ -102,7 +104,9 @@ const destroy = async menu => {
showCancelButton: true,
})
response.isConfirmed && Inertia.delete(route('superuser.menu.destroy', menu.id))
response.isConfirmed && Inertia.delete(route('superuser.menu.destroy', menu.id), {
onSuccess: () => Inertia.get(route(route().current()))
})
}
const submit = () => form.id ? update() : store()