This commit is contained in:
Jonathan Chevalier
2022-10-19 15:40:56 +02:00
parent 745df5a07e
commit da9a5580bb

View File

@@ -40,7 +40,7 @@ export default {
addToCart: async function (idProduct) { addToCart: async function (idProduct) {
this.suspens = true this.suspens = true
const urlApi = '/php/api/v3/mmcm.php?EXEC=addToCart&ID_PRODUCT=' + this.store.idProduct let urlApi = '/php/api/v3/mmcm.php?EXEC=addToCart&ID_PRODUCT=' + this.store.idProduct
+ '&with_prescription=' + this.store.withPrescription + '&with_prescription=' + this.store.withPrescription
+ '&date_delivery=' + this.store.dateDeliveryTimestampInSecond + '&date_delivery=' + this.store.dateDeliveryTimestampInSecond
+ '&date_collect=' + this.store.dateCollectTimestampInSecond + '&date_collect=' + this.store.dateCollectTimestampInSecond
@@ -51,9 +51,15 @@ export default {
if(import.meta.env.DEV){ if(import.meta.env.DEV){
console.log(urlApi) console.log(urlApi)
urlApi += '&ID_SESSION=6xCvNjBA';
} }
const result = await fetch(urlApi).then(rep => rep.json()) const result = await fetch(urlApi).then(rep => rep.json())
if(import.meta.env.DEV){
console.log(result)
}
if (result.id_session) { if (result.id_session) {
this.suspens = false this.suspens = false
this.store.setIdSession(result.id_session) this.store.setIdSession(result.id_session)