Skip to content

Commit f78038b

Browse files
luizhf42otavio
authored andcommitted
fix(ui): reset UserFormDialog data on submit
1 parent 7a008b4 commit f78038b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ui/admin/src/components/User/UserFormDialog.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,11 @@ const handleErrors = (error: AxiosError) => {
262262
});
263263
};
264264
265+
const close = () => {
266+
showDialog.value = false;
267+
resetFormFields();
268+
};
269+
265270
const submitUser = async (
266271
isCreating: boolean,
267272
userData: IAdminUserFormData,
@@ -277,7 +282,7 @@ const submitUser = async (
277282
);
278283
279284
await usersStore.fetchUsersList();
280-
showDialog.value = false;
285+
close();
281286
} catch (error: unknown) {
282287
if (axios.isAxiosError(error)) {
283288
handleErrors(error as AxiosError);
@@ -322,11 +327,6 @@ const submitForm = handleSubmit(async () => {
322327
}
323328
});
324329
325-
const close = () => {
326-
showDialog.value = false;
327-
resetFormFields();
328-
};
329-
330330
defineExpose({
331331
showDialog,
332332
password,

0 commit comments

Comments
 (0)