From dd467e8ef83f3e9408aa7839146f4ba86e4e2204 Mon Sep 17 00:00:00 2001 From: Chad Derya Date: Wed, 11 Sep 2019 09:52:04 +0100 Subject: [PATCH] re labeled all instances of account to terminal, clear create terminal after save --- src/views/terminals/components/TerminalDetail.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/views/terminals/components/TerminalDetail.vue b/src/views/terminals/components/TerminalDetail.vue index 5573a3df..54967c2a 100644 --- a/src/views/terminals/components/TerminalDetail.vue +++ b/src/views/terminals/components/TerminalDetail.vue @@ -31,7 +31,7 @@ @@ -109,7 +109,7 @@ const defaultForm = { } export default { - name: 'AccountDetail', + name: 'TerminalDetail', components: { Sticky }, props: { isEdit: { @@ -162,6 +162,7 @@ export default { this.fetchData(id) } else { this.postForm = Object.assign({}, defaultForm) + this.postForm.address = Object.assign({}, defaultForm.address) } // Why need to make a copy of this.$route here? @@ -184,12 +185,12 @@ export default { }) }, setTagsViewTitle() { - const title = 'Edit Account' + const title = 'Edit Terminal' const route = Object.assign({}, this.tempRoute, { title: `${title} - ${this.postForm.name}` }) this.$store.dispatch('tagsView/updateVisitedView', route) }, setPageTitle() { - const title = 'Edit Account' + const title = 'Edit Terminal' document.title = `${title} - ${this.postForm.id}` }, submitForm() { @@ -197,18 +198,18 @@ export default { if (valid) { this.loading = true - // Save the account + // Save the terminal const methodToCall = this.isEdit ? updateTerminal : createTerminal methodToCall(this.postForm).then((r) => { this.$notify({ title: 'Success', - message: 'Account Saved', + message: 'Terminal Saved', type: 'success', duration: 2000 }) // Redirect to the edit page when we create a new one - if (!this.isEdit) { this.$router.push(`/accounts/edit/${r.data.id}`) } + if (!this.isEdit) { this.$router.push(`/terminals/edit/${r.data.id}`) } this.loading = false }).catch((e) => {