This commit is contained in:
Jonathan Chevalier
2022-11-09 17:40:21 +01:00
parent 8dcd07fce0
commit 7e418a07ee
4 changed files with 21 additions and 13 deletions

View File

@@ -72,9 +72,9 @@ const timestampConverter = (digit13) => digit13 / 1000
export const useMMCMStore = defineStore('counter', {
state: () => ({
idSession: '',
street: '',
zipCode: '',
city: '',
street: null,
zipCode: null,
city: null,
productList: [],
withPrescription: null,
idProduct: null,
@@ -82,7 +82,7 @@ export const useMMCMStore = defineStore('counter', {
dateCollect: null
}),
getters: {
fullAddress: (state) => state.street + ' ' + state.zipCode + ' ' + state.city,
fullAddress: (state) => (state.street !== null) ? state.street + ' ' + state.zipCode + ' ' + state.city : null,
deliveryMethod: (state) => state.productList.filter(p => p.id === state.idProduct)[0].name,
deliveryMethodCode: (state) => state.productList.filter(p => p.id === state.idProduct)[0].ref,
dateDeliveryString: (state) => new Date(state.dateDelivery).toLocaleDateString("fr-FR"),