@@ -19,7 +20,7 @@
-
+
@@ -31,14 +32,21 @@
-
+
-
+
-
-
+
+
+
+
+
+
+
+
+
@@ -77,6 +85,13 @@
+
+
+
+
+
+
+
@@ -105,19 +120,23 @@ const fetchRegionList = require('@/api/region').fetchList
const defaultForm = {
id: '',
name: '',
+ fullName: '',
+ contactNumber: '',
region_id: '',
- identifier: '',
address: {
line1: '',
line2: '',
county: '',
postCode: '',
country: ''
+ },
+ meta: {
+ openingHours: ''
}
}
export default {
- name: 'TerminalDetail',
+ name: 'AccountDetail',
components: { Sticky },
props: {
isEdit: {
@@ -170,7 +189,6 @@ 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?
@@ -181,7 +199,15 @@ export default {
methods: {
fetchData(id) {
fetchTerminal(id).then(response => {
- this.postForm = response.data
+ const terminal = response.data
+
+ if (!terminal.meta) {
+ terminal.meta = {
+ openingHours: ''
+ }
+ }
+
+ this.postForm = terminal
// // set tagsview title
this.setTagsViewTitle()
@@ -206,7 +232,7 @@ export default {
if (valid) {
this.loading = true
- // Save the terminal
+ // Save the account
const methodToCall = this.isEdit ? updateTerminal : createTerminal
methodToCall(this.postForm).then((r) => {
this.$notify({
@@ -217,7 +243,8 @@ export default {
})
// Redirect to the edit page when we create a new one
- if (!this.isEdit) { this.$router.push(`/terminals/edit/${r.data.createdTerminal._id}`) }
+ if (!this.isEdit) { this.$router.push(`/terminals/edit/${r.data.id}`) }
+
this.loading = false
}).catch((e) => {
console.dir(e)
@@ -230,7 +257,7 @@ export default {
},
getRemoteRegionList(query) {
query = {}
- query.platform = this.$store.state.platform
+ query.platform = 'OLFDE'
query.limit = 100
fetchRegionList(query).then(response => {
if (!response.data.regions) return
diff --git a/src/views/users/list.vue b/src/views/users/list.vue
index d531bb82..758e3105 100644
--- a/src/views/users/list.vue
+++ b/src/views/users/list.vue
@@ -50,13 +50,16 @@
-
+
Edit
+
+ Send PW Reset
+
@@ -67,7 +70,7 @@