rsanchez
2017-06-07 89a0646d18da6f3290a883121e38f4086a6fb37e
securis/src/main/webapp/src/app/resources/packs.ts
....@@ -1,7 +1,7 @@
11 import { Observable } from 'rxjs/Rx';
22 import { Injectable } from '@angular/core';
33 import { Http, RequestOptions } from '@angular/http';
4
-import { SeCurisResourceServices } from './base';
4
+import { SeCurisResourceServices, MySearchParams } from './base';
55 import { LocaleService } from '../common/i18n';
66
77 var pack_example = {
....@@ -31,6 +31,13 @@
3131 organization_name: 'CurisTec',
3232 preactivation_valid_period: 70,
3333 renew_valid_period: 0,
34
+}
35
+
36
+export type PacksFilter = {
37
+ licenseTypeId?: number;
38
+ organizationId?: number;
39
+ applicationId?: number;
40
+ name?: string;
3441 }
3542
3643 export const PACK_STATUS = {
....@@ -79,6 +86,13 @@
7986 super($L, http, 'pack');
8087 }
8188
89
+ public get(filter?: PacksFilter) {
90
+ let searchParams = new MySearchParams(filter);
91
+ let url = `${this.resource}/?${searchParams}`;
92
+ console.log(`url: ${url}`);
93
+ return this.http.get(url).map(response => response.json()).catch(err => super.processErrorResponse(err));
94
+ }
95
+
8296 public activate(id: number) {
8397 return super.action(id, "activate");
8498 }