Skip to content

Commit

Permalink
(fix): allow server/user details to be modified several times
Browse files Browse the repository at this point in the history
  • Loading branch information
camwhit-e committed Nov 2, 2024
1 parent 9fe8248 commit bf087b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/js/Pages/Servers/ServerForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Users/UserForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bf087b0

Please sign in to comment.