From dc9e629df0d08107c12fa0145be08456ca4cdf03 Mon Sep 17 00:00:00 2001 From: Jane Sandberg Date: Wed, 9 Oct 2019 20:27:43 -0700 Subject: [PATCH] LP1816475: Strip whitespace from patron barcodes Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- .../src/app/share/validators/patron_barcode_validator.directive.ts | 2 +- .../eg2/src/app/staff/booking/create-reservation-dialog.component.ts | 4 ++-- .../src/eg2/src/app/staff/booking/manage-reservations.component.ts | 2 +- Open-ILS/src/eg2/src/app/staff/share/patron.service.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/share/validators/patron_barcode_validator.directive.ts b/Open-ILS/src/eg2/src/app/share/validators/patron_barcode_validator.directive.ts index 81d1b159b0..0910bf3ba1 100644 --- a/Open-ILS/src/eg2/src/app/share/validators/patron_barcode_validator.directive.ts +++ b/Open-ILS/src/eg2/src/app/share/validators/patron_barcode_validator.directive.ts @@ -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) => { diff --git a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts index 370e35ae90..82a14bfdbe 100644 --- a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation-dialog.component.ts @@ -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( diff --git a/Open-ILS/src/eg2/src/app/staff/booking/manage-reservations.component.ts b/Open-ILS/src/eg2/src/app/staff/booking/manage-reservations.component.ts index 283257eda1..dd3e0ca32f 100644 --- a/Open-ILS/src/eg2/src/app/staff/booking/manage-reservations.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/booking/manage-reservations.component.ts @@ -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]) diff --git a/Open-ILS/src/eg2/src/app/staff/share/patron.service.ts b/Open-ILS/src/eg2/src/app/staff/share/patron.service.ts index b11626c71d..12fd1e137b 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/patron.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/patron.service.ts @@ -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()); } } -- 2.11.0