Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2019-10-31 14:26:12 -0400
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2019-10-31 14:26:12 -0400
commit64718d55134612f96a61e3779d8e057b161e318c (patch)
tree67a790277ec3b6b54e52952bbbde7f2ba8b51522 /src
parentf0e246deef1e10f382cafcd36eca89620a8f6ace (diff)
downloadliza-64718d55134612f96a61e3779d8e057b161e318c.tar.gz
liza-64718d55134612f96a61e3779d8e057b161e318c.tar.bz2
liza-64718d55134612f96a61e3779d8e057b161e318c.zip
RatingService: Fix initialRatedDate and lastRatedDate reply
Recent changes caused the quote to be read before it was mutated by _saveRatingData.
Diffstat (limited to 'src')
-rw-r--r--src/server/service/RatingService.ts22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/server/service/RatingService.ts b/src/server/service/RatingService.ts
index b2a5062..f95f4ea 100644
--- a/src/server/service/RatingService.ts
+++ b/src/server/service/RatingService.ts
@@ -212,22 +212,22 @@ export class RatingService
quote, class_dest, () => {}, () => {}
);
- const result = {
- data: cleaned,
- initialRatedDate: quote.getRatedDate(),
- lastRatedDate: quote.getLastPremiumDate()
- };
-
// save all data server-side (important: do after
// post-processing); async
- this._saveRatingData( quote, rate_data, indv, function()
+ this._saveRatingData( quote, rate_data, indv, () =>
{
- // we're done
+ const result = {
+ data: cleaned,
+ initialRatedDate: quote.getRatedDate(),
+ lastRatedDate: quote.getLastPremiumDate()
+ };
+
+ this._server.sendResponse(
+ request, quote, result, actions
+ );
+
resolve( result );
} );
-
- // no need to wait for the save; send the response
- this._server.sendResponse( request, quote, result, actions );
},
( message: string ) =>
{