|
|
@@ -35,7 +35,6 @@
|
|
|
outlined
|
|
|
label="Tipo de Usuário"
|
|
|
:rules="[inputRules.required]"
|
|
|
- :type="editUserTypeValue"
|
|
|
/>
|
|
|
|
|
|
<DefaultInput
|
|
|
@@ -169,7 +168,6 @@ const avatarFile = ref(null);
|
|
|
const showPassword = ref(false);
|
|
|
const showPasswordConfirm = ref(false);
|
|
|
|
|
|
-const editUserTypeValue = ref(null);
|
|
|
const editStateId = ref(null);
|
|
|
const editUnitId = ref(null);
|
|
|
|
|
|
@@ -200,7 +198,7 @@ onMounted(async () => {
|
|
|
form.value.name = user.name;
|
|
|
form.value.email = user.email;
|
|
|
form.value.cpf = user.cpf;
|
|
|
- editUserTypeValue.value = user.user_type;
|
|
|
+ form.value.user_type = user.user_type;
|
|
|
editStateId.value = user.state_id ?? null;
|
|
|
editUnitId.value = user.unit_id ?? null;
|
|
|
if (user.avatar_url) {
|
|
|
@@ -217,8 +215,7 @@ function buildFormData() {
|
|
|
if (avatarFile.value) fd.append("avatar", avatarFile.value);
|
|
|
if (form.value.state?.value) fd.append("state_id", form.value.state.value);
|
|
|
if (form.value.unit?.value) fd.append("unit_id", form.value.unit.value);
|
|
|
- if (form.value.user_type?.value)
|
|
|
- fd.append("user_type", form.value.user_type.value);
|
|
|
+ if (form.value.user_type) fd.append("user_type", form.value.user_type);
|
|
|
if (form.value.cpf) fd.append("cpf", form.value.cpf);
|
|
|
|
|
|
fd.append("name", form.value.name ?? "");
|
|
|
@@ -235,8 +232,7 @@ function buildUpdateData() {
|
|
|
if (avatarFile.value) fd.append("avatar", avatarFile.value);
|
|
|
if (form.value.state?.value) fd.append("state_id", form.value.state.value);
|
|
|
if (form.value.unit?.value) fd.append("unit_id", form.value.unit.value);
|
|
|
- if (form.value.user_type?.value)
|
|
|
- fd.append("user_type", form.value.user_type.value);
|
|
|
+ if (form.value.user_type) fd.append("user_type", form.value.user_type);
|
|
|
if (form.value.cpf) fd.append("cpf", form.value.cpf);
|
|
|
if (form.value.name) fd.append("name", form.value.name);
|
|
|
if (form.value.email) fd.append("email", form.value.email);
|