From bf00a6c41205fd16da00635c486df622eb92bb6c Mon Sep 17 00:00:00 2001 From: sp Date: Mon, 31 May 2021 17:15:21 +1000 Subject: [PATCH] bugfix for add on time milestone. --- apiV1LoanSingle.go | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/apiV1LoanSingle.go b/apiV1LoanSingle.go index b0974fb..3440020 100644 --- a/apiV1LoanSingle.go +++ b/apiV1LoanSingle.go @@ -51,14 +51,31 @@ func apiV1LoanSinglePostBasic(w http.ResponseWriter, r *http.Request, ss *loan.S l.Rating = input.Rating l.Settlement = input.Settlement l.Description = input.Description + + l.ApplicationReceived = input.ApplicationReceived + l.Lodgement = input.Lodgement + l.ValuationOrdered = input.ValuationOrdered + l.ValuationCompleted = input.ValuationCompleted + l.ConditionalApproved = input.ConditionalApproved + l.OutstandingReturned = input.OutstandingReturned + l.FormalApproved = input.FormalApproved + l.SettlementBooked = input.SettlementBooked + l.SettlementCompleted = input.SettlementCompleted + e = l.WriteBasic() if e != nil { log.Error("cannot save basic loan", e.Error()) apiV1Client404Error(w, r, ss) - } else { - apiV1SendJson(l, w, r, ss) + return } + e = l.WriteMileStone() + if e != nil { + log.Error("cannot save milestone ", e.Error()) + apiV1Server500Error(w, r) + return + } + apiV1SendJson(l, w, r, ss) } }