0👍
Try Inertia.put()
instead, since you sending it via PUT
request. Also I think you can also use form.put()
so that you don’t to type the attributes again. just make sure that the const form = useForm()
.
0👍
You could also use the Inertia.form()
.
<script setup>
import { Inertia } from '@inertiajs/inertia';
const props = defineProps({
user: Object,
avatar: String,
});
const form = Inertia.form({
username: props.user.username,
name: props.user.name,
lastname: props.user.lastname,
email: props.user.email,
role_id: props.user.role_id,
avatar: null,
});
function updateUser() {
form.put(`/dashboard/users/${props.user.id}`, form)
}
</script>
- [Vuejs]-What am I doing wrong with this openAI API?
- [Vuejs]-How to properly add an event listener to a child window in vuejs?
Source:stackexchange.com