fix(webui): edit book dialog would not save or reset properly

This commit is contained in:
Gauthier Roebroeck 2021-12-31 09:51:21 +08:00
parent d6611db081
commit e4b912e607

View file

@ -548,7 +548,7 @@ export default Vue.extend({
}, },
dialogReset(books: BookDto | BookDto[]) { dialogReset(books: BookDto | BookDto[]) {
this.tab = 0; this.tab = 0;
(this.$refs.customRoleForm as any)?.reset() (this.$refs.customRoleForm as any)?.reset();
(this.$refs.linksForm as any)?.resetValidation() (this.$refs.linksForm as any)?.resetValidation()
this.customRoles = [] this.customRoles = []
this.$v.$reset() this.$v.$reset()
@ -583,7 +583,7 @@ export default Vue.extend({
} }
}, },
validateForm(): any { validateForm(): any {
if (!this.$v.$invalid && (!this.single || (this.$refs.linksForm as any).validate())) { if (!this.$v.$invalid && (!this.single || !this.$refs.linksForm || (this.$refs.linksForm as any).validate())) {
const metadata = { const metadata = {
authorsLock: this.form.authorsLock, authorsLock: this.form.authorsLock,
tagsLock: this.form.tagsLock, tagsLock: this.form.tagsLock,