From bf087b07a3f65db7fcece405585e66dbe0c90d4b Mon Sep 17 00:00:00 2001 From: camw0 Date: Sat, 2 Nov 2024 13:32:50 +0000 Subject: [PATCH] (fix): allow server/user details to be modified several times --- resources/js/Pages/Servers/ServerForm.tsx | 2 +- resources/js/Pages/Users/UserForm.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/js/Pages/Servers/ServerForm.tsx b/resources/js/Pages/Servers/ServerForm.tsx index 5f1c09a..a5a0890 100644 --- a/resources/js/Pages/Servers/ServerForm.tsx +++ b/resources/js/Pages/Servers/ServerForm.tsx @@ -25,7 +25,7 @@ export default function ServerForm({ server }: { server?: Server }) { function handleSubmit(e: { preventDefault: () => void }) { e.preventDefault(); - if (server) { + if (server!.id) { router.put(`/servers/${server!.id}`, values); } else { router.post('/servers/new', values); diff --git a/resources/js/Pages/Users/UserForm.tsx b/resources/js/Pages/Users/UserForm.tsx index dc55dc6..b295430 100644 --- a/resources/js/Pages/Users/UserForm.tsx +++ b/resources/js/Pages/Users/UserForm.tsx @@ -26,7 +26,7 @@ export default function UserForm({ user }: { user?: User }) { function handleSubmit(e: { preventDefault: () => void }) { e.preventDefault(); - if (user) { + if (user!.id) { router.put(`/users/${user!.id}`, values); } else { router.post('/users/new', values);