Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 11f3608

Browse files
committed
Dispute Cases Issues
1 parent 1827535 commit 11f3608

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

api/jsonapi.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,6 +2221,12 @@ func (i *jsonAPIHandler) GETCase(w http.ResponseWriter, r *http.Request) {
22212221
ErrorResponse(w, http.StatusInternalServerError, err.Error())
22222222
return
22232223
}
2224+
2225+
if buyerContract.BuyerOrder.Payment.BigAmount == "" {
2226+
v5order, _ := repo.ToV5Order(buyerContract.BuyerOrder, nil)
2227+
buyerContract.BuyerOrder = v5order
2228+
}
2229+
22242230
resp.BuyerContract = buyerContract
22252231
resp.VendorContract = vendorContract
22262232
resp.BuyerOpened = buyerOpened

repo/db/cases.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,13 @@ func (c *CasesDB) GetAll(stateFilter []pb.OrderState, searchTerm string, sortByA
282282
buyerHandle = contract.BuyerOrder.BuyerID.Handle
283283
}
284284
if contract.BuyerOrder.Payment != nil {
285-
total0, _ := new(big.Int).SetString(contract.BuyerOrder.Payment.BigAmount, 10)
286-
total = total0
285+
if contract.BuyerOrder.Payment.BigAmount != "" {
286+
total0, _ := new(big.Int).SetString(contract.BuyerOrder.Payment.BigAmount, 10)
287+
total = total0
288+
} else {
289+
total1 := new(big.Int).SetUint64(contract.BuyerOrder.Payment.Amount)
290+
total = total1
291+
}
287292
}
288293
}
289294

0 commit comments

Comments
 (0)