|
|
@@ -127,8 +127,7 @@ export class MainViewModel{
|
|
|
try {
|
|
|
let ans = await BabyFoodApi.updatePurchaseStatus(Id)
|
|
|
let l = this.purchaseList![index]
|
|
|
- if(ans == '0') l.purchased = true
|
|
|
- else l.purchased = false
|
|
|
+ l.purchased = l.purchased == '1' ? '0' : '1'
|
|
|
this.purchaseList?.splice(index, 1, l)
|
|
|
} catch (e) {
|
|
|
console.log(`e = ${JSON.stringify(e)}`)
|