immidb / idb

A Web Application Database for Immigration Law Practitioners
https://immidb.net
1 stars 0 forks source link

change model.onSave() newValueModified not updated for object new.arrayDoc #45

Open tonybranfort opened 7 years ago

tonybranfort commented 7 years ago

Submitting a new.arrayDoc change where the model has an onSave() function does not update the newValueModified in the change doc. So the change implemented does not include the onSave() modifications.

Found via new txtn on client. txtn model onSave had (removed) a txtnDate fixDate() function which modified the date. The fixDate() function DID run and returned the modified date but the newValueModified object was not updated with that updated date. Seems to be in mongoose-extend.

tonybranfort commented 7 years ago

Confirmed this also occurs on replace.arrayDoc. See application (uscis) onSave() dateSubmitted, dateReceived. Dates are saved with local time rather than updated to :12:00:00z