Moves the logic of when to apply a value for ack_staff into the copy
alerts dialog.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Elaine Hardy <ehardy@georgialibraries.org>
existing.alert_type(alert.alert_type());
existing.temp(alert.temp());
existing.ack_time(alert.ack_time());
- if (alert.ack_time() === 'now') {
- existing.ack_staff(this.auth.user().id());
- }
+ existing.ack_staff(alert.ack_staff());
copy.ischanged(true);
}
});
const changedAlerts = this.copy ?
this.copy.copy_alerts().filter(a => a.ischanged()) :
[];
+
+ changedAlerts.forEach(alrt => {
+ if (alrt.ack_time() === 'now') {
+ alrt.ack_staff(this.auth.user().id());
+ }
+ });
+
if (this.inPlaceCreateMode) {
this.close({ newAlerts: this.newAlerts, changedAlerts: changedAlerts });
return;