LP1816475: Put the resource barcodes in order
[Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / booking / create-reservation.component.ts
index 1b25f41..7461a6c 100644 (file)
@@ -272,7 +272,11 @@ export class CreateReservationComponent implements OnInit, AfterViewInit, OnDest
         }
 
         resources$.pipe(
-            tap((resource) => this.resources.push(resource)),
+            tap((resource) =>  {
+                this.resources.push(resource);
+                this.resources.sort((a,b) =>
+                    (a.barcode() > b.barcode()) ? 1 : ((b.barcode() > a.barcode()) ? -1 : 0));
+            }),
             takeLast(1),
             switchMap(() => {
                 let range = {startTime: Moment(), endTime: Moment()};