LP1816475: Strip whitespace from patron barcodes
authorJane Sandberg <sandbej@linnbenton.edu>
Thu, 10 Oct 2019 03:27:43 +0000 (20:27 -0700)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 21 Oct 2019 19:43:16 +0000 (15:43 -0400)
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/share/validators/patron_barcode_validator.directive.ts
Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts
Open-ILS/src/eg2/src/app/staff/booking/manage-reservations.component.ts
Open-ILS/src/eg2/src/app/staff/share/patron.service.ts

index 81d1b15..0910bf3 100644 (file)
@@ -19,7 +19,7 @@ export class PatronBarcodeValidator implements AsyncValidator {
             'open-ils.actor.get_barcodes',
             this.auth.token(),
             this.auth.user().ws_ou(),
-            'actor', control.value));
+            'actor', control.value.trim()));
     }
 
     private parseActorCall = (actorCall: Observable<any>) => {
index 370e35a..82a14bf 100644 (file)
@@ -104,7 +104,7 @@ export class CreateReservationDialogComponent
                 'open-ils.booking',
                 'open-ils.booking.reservations.create',
                 this.auth.token(),
-                this.patronBarcode.value,
+                this.patronBarcode.value.trim(),
                 this.selectedTimes,
                 this.pickupLibId,
                 this.targetResourceType.id,
@@ -147,7 +147,7 @@ export class CreateReservationDialogComponent
                         'open-ils.actor.get_barcodes',
                         this.auth.token(),
                         this.auth.user().ws_ou(),
-                        'actor', this.patronBarcode.value).pipe(
+                        'actor', this.patronBarcode.value.trim()).pipe(
                             single(),
                             switchMap((result) => {
                                 return this.pcrud.retrieve('au', result[0]['id']).pipe(
index 283257e..dd3e0ca 100644 (file)
@@ -73,7 +73,7 @@ export class ManageReservationsComponent implements OnInit, OnDestroy {
                             'open-ils.actor',
                             'open-ils.actor.get_barcodes',
                             this.auth.token(), this.auth.user().ws_ou(),
-                           'actor', this.patronBarcode.value).pipe(
+                           'actor', this.patronBarcode.value.trim()).pipe(
                                single(),
                                tap((response) =>
                                    this.router.navigate(['/staff', 'booking', 'manage_reservations', 'by_patron', response[0].id])
index b11626c..12fd1e1 100644 (file)
@@ -16,7 +16,7 @@ export class PatronService {
             'open-ils.actor',
             'open-ils.actor.get_barcodes',
             this.auth.token(), this.auth.user().ws_ou(),
-           'actor', barcode);
+           'actor', barcode.trim());
     }
 
 }