Skip to content

Commit

Permalink
profileeditor: add created_at, srvModified too on save to simulate AP…
Browse files Browse the repository at this point in the history
…I v3
  • Loading branch information
MilosKozak committed Jan 20, 2023
1 parent 6b841fa commit ffb14c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/profile/profileeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ var init = function init () {
profileSubmit();
}
GUIToObject();
mongorecords.push(_.omit(mongorecords[currentrecord], ['_id', 'srvModified', 'srvCreated', 'identifier']));
mongorecords.push(_.omit(mongorecords[currentrecord], ['_id', 'srvModified', 'srvCreated', 'identifier', 'mills']));
currentrecord = mongorecords.length - 1;
mongorecords[currentrecord].startDate = new Date().toISOString();
currentprofile = mongorecords[currentrecord].defaultProfile;
Expand Down Expand Up @@ -651,6 +651,8 @@ var init = function init () {
profileChange(event);
var record = mongorecords[currentrecord];
record.startDate = new Date(client.utils.mergeInputTime(timeInput.val(), dateInput.val())).toISOString( );
record.created_at = new Date().toISOString( );
record.srvModified = new Date().getTime(); // remove when switching to v3 API

var adjustedRecord = _.cloneDeep(record);

Expand Down

0 comments on commit ffb14c9

Please sign in to comment.