LP1904036 Batch hold edit set bools false
authorBill Erickson <berickxx@gmail.com>
Thu, 28 Oct 2021 14:23:04 +0000 (10:23 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:38 +0000 (20:13 -0400)
Avoid sending null values on batch hold update for boolean fields.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Open-ILS/src/eg2/src/app/staff/share/holds/manage.component.ts

index f21e649..4dd2d56 100644 (file)
@@ -66,6 +66,12 @@ export class HoldManageComponent implements OnInit {
             // Use a dummy hold to store form values.
             this.hold = this.idl.create('ahr');
 
+            // Set all boolean fields to false on startup so they are
+            // not sent to the server as null when saving.
+            this.idl.classes.ahr.fields
+                .filter(f => f.datatype === 'bool')
+                .forEach(f => this.hold[f.name]('f'));
+
         } else {
             // Form values are stored in the one hold we're editing.
             this.pcrud.retrieve('ahr', this.holdIds[0])