addtocash using sendcoins Circuit

This commit is contained in:
Surya Paolo
2024-01-03 15:46:48 +01:00
parent eee069c039
commit 605f6afa0d
11 changed files with 25 additions and 4 deletions

View File

@@ -60,11 +60,14 @@ function getRecordProductEmpty(): IProduct {
stockQty: 0,
stockBloccatiQty: 0,
bookedQtyOrdered: 0,
bookedQtyConfirmed: 0,
qtyToReachForGas: 0,
maxbookableGASQty: 0,
bookedGASQtyOrdered: 0,
bookedGASQtyConfirmed: 0,
bookableGASBloccatiQty: 0,
canBeShipped: false,
@@ -621,6 +624,10 @@ export const useProducts = defineStore('Products', {
return ris
},
getOptions() {
return {}
},
async CreateOrdersCart({ cart_id, status, note }: { cart_id: string, status: number, note: string }) {
const userStore = useUserStore()
@@ -631,7 +638,7 @@ export const useProducts = defineStore('Products', {
let ris = null
ris = await Api.SendReq('/cart/' + userStore.my._id + '/createorderscart', 'POST', { cart_id, status, note })
ris = await Api.SendReq('/cart/' + userStore.my._id + '/createorderscart', 'POST', { cart_id, status, note, options: this.getOptions() })
.then((res) => {
if (res.data.status === shared_consts.OrderStatus.CHECKOUT_SENT) {
@@ -662,7 +669,7 @@ export const useProducts = defineStore('Products', {
let ris = null
ris = await Api.SendReq('/cart/updatestatuscart', 'POST', { ordercart_id, status })
ris = await Api.SendReq('/cart/updatestatuscart', 'POST', { ordercart_id, status, options: this.getOptions() })
.then((res) => {
if (res.data.status === shared_consts.OrderStatus.CHECKOUT_SENT) {
@@ -681,6 +688,8 @@ export const useProducts = defineStore('Products', {
return ris
},
async UpdateOrderCartStatus({ order_id, status }: { order_id: string, status: number }) {
const userStore = useUserStore()
@@ -691,7 +700,7 @@ export const useProducts = defineStore('Products', {
let ris = null
ris = await Api.SendReq('/cart/' + userStore.my._id + '/ordercartstatus', 'POST', { order_id, status, options })
ris = await Api.SendReq('/cart/' + userStore.my._id + '/ordercartstatus', 'POST', { order_id, status, options: this.getOptions() })
.then((res) => {
this.updateDataProduct(res)