LP1901930 SIP accout list more filterable
authorBill Erickson <berickxx@gmail.com>
Tue, 8 Jun 2021 20:57:25 +0000 (16:57 -0400)
committerBill Erickson <berickxx@gmail.com>
Tue, 8 Jun 2021 20:57:25 +0000 (16:57 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/admin/server/sip/account-list.component.ts

index dcf204e..2bf33a5 100644 (file)
@@ -37,12 +37,20 @@ export class SipAccountListComponent implements OnInit {
 
     fetchAccounts(pager: Pager, sort: any[]): Observable<any> {
 
-        const orderBy: any = {sisacc: 'sip_username'};
+        const orderBy: any = {sipacc: 'sip_username'};
         if (sort.length) {
-            orderBy.sisacc = sort[0].name + ' ' + sort[0].dir;
+            orderBy.sipacc = sort[0].name + ' ' + sort[0].dir;
         }
 
-        return this.pcrud.retrieveAll('sipacc', {
+        const query = [{id: {'!=': null}}];
+
+        Object.keys(this.gridSource.filters).forEach(key => {
+            Object.keys(this.gridSource.filters[key]).forEach(key2 => {
+                query.push(this.gridSource.filters[key][key2]);
+            });
+        });
+
+        return this.pcrud.search('sipacc', query, {
             offset: pager.offset,
             limit: pager.limit,
             order_by: orderBy,