Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Письменов Дмитрий Иванович
/
yourroomads
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9a01ae5e
authored
Dec 22, 2020
by
Jonathan Reinink
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix edit user form resetting
1 parent
3c9d00de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
resources/js/Pages/Users/Edit.vue
resources/js/Pages/Users/Edit.vue
View file @
9a01ae5
...
...
@@ -12,7 +12,7 @@
This user has been deleted.
</trashed-message>
<div
class=
"bg-white rounded shadow overflow-hidden max-w-3xl"
>
<form
@
submit
.
prevent=
"
form.post(route('users.update', user.id))
"
>
<form
@
submit
.
prevent=
"
submit
"
>
<div
class=
"p-8 -mr-6 -mb-8 flex flex-wrap"
>
<text-input
v-model=
"form.first_name"
:error=
"form.errors.first_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"First name"
/>
<text-input
v-model=
"form.last_name"
:error=
"form.errors.last_name"
class=
"pr-6 pb-8 w-full lg:w-1/2"
label=
"Last name"
/>
...
...
@@ -66,13 +66,18 @@ export default {
first_name
:
this
.
user
.
first_name
,
last_name
:
this
.
user
.
last_name
,
email
:
this
.
user
.
email
,
password
:
this
.
user
.
password
,
password
:
null
,
owner
:
this
.
user
.
owner
,
photo
:
null
,
}),
}
},
methods
:
{
submit
()
{
this
.
form
.
post
(
this
.
route
(
'users.update'
,
this
.
user
.
id
),
{
onSuccess
:
()
=>
this
.
form
.
reset
(
'password'
,
'photo'
),
})
},
destroy
()
{
if
(
confirm
(
'Are you sure you want to delete this user?'
))
{
this
.
$inertia
.
delete
(
this
.
route
(
'users.destroy'
,
this
.
user
.
id
))
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment