Skip to content

Commit

Permalink
Remove implicit form method calls (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacobtims authored Jun 16, 2023
1 parent ed9df82 commit 1cb124f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ const form = useForm({
const submit = () => {
form.post(route('password.confirm'), {
onFinish: () => form.reset(),
onFinish: () => {
form.reset();
},
});
};
</script>
Expand Down
4 changes: 3 additions & 1 deletion stubs/inertia-vue-ts/resources/js/Pages/Auth/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const form = useForm({
const submit = () => {
form.post(route('login'), {
onFinish: () => form.reset('password'),
onFinish: () => {
form.reset('password');
},
});
};
</script>
Expand Down
4 changes: 3 additions & 1 deletion stubs/inertia-vue-ts/resources/js/Pages/Auth/Register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const form = useForm({
const submit = () => {
form.post(route('register'), {
onFinish: () => form.reset('password', 'password_confirmation'),
onFinish: () => {
form.reset('password', 'password_confirmation');
},
});
};
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const form = useForm({
const submit = () => {
form.post(route('password.store'), {
onFinish: () => form.reset('password', 'password_confirmation'),
onFinish: () => {
form.reset('password', 'password_confirmation');
},
});
};
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ const deleteUser = () => {
preserveScroll: true,
onSuccess: () => closeModal(),
onError: () => passwordInput.value?.focus(),
onFinish: () => form.reset(),
onFinish: () => {
form.reset();
},
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ const form = useForm({
const updatePassword = () => {
form.put(route('password.update'), {
preserveScroll: true,
onSuccess: () => form.reset(),
onSuccess: () => {
form.reset();
},
onError: () => {
if (form.errors.password) {
form.reset('password', 'password_confirmation');
Expand Down

0 comments on commit 1cb124f

Please sign in to comment.