You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
616 B
20 lines
616 B
|
|
$(document).ready( () => {
|
|
console.log('Load component - thankyou')
|
|
const component = $('.component-thankyou')
|
|
|
|
if(component.length) {
|
|
const data = sessionStorage.getItem('order') ? JSON.parse(sessionStorage.getItem('order')) : null
|
|
if(!data) {
|
|
window.location='/'
|
|
} else {
|
|
|
|
const urlParams = new URLSearchParams(window.location.search)
|
|
Apis.saveOrder(data.profile, data.cartItems, data.token, data.uid, data.amount, urlParams.has('token')).then( (e) => {
|
|
sessionStorage.removeItem('order')
|
|
}).catch( (error) => {
|
|
console.error(error)
|
|
})
|
|
}
|
|
}
|
|
})
|