| .. | .. |
|---|
| 1 | 1 | import { Observable } from 'rxjs/Rx'; |
|---|
| 2 | 2 | import { Injectable } from '@angular/core'; |
|---|
| 3 | 3 | import { Http, RequestOptions } from '@angular/http'; |
|---|
| 4 | | -import { SeCurisResourceServices } from './base'; |
|---|
| 4 | +import { SeCurisResourceServices, MySearchParams } from './base'; |
|---|
| 5 | 5 | import { LocaleService } from '../common/i18n'; |
|---|
| 6 | 6 | |
|---|
| 7 | 7 | var pack_example = { |
|---|
| .. | .. |
|---|
| 31 | 31 | organization_name: 'CurisTec', |
|---|
| 32 | 32 | preactivation_valid_period: 70, |
|---|
| 33 | 33 | renew_valid_period: 0, |
|---|
| 34 | +} |
|---|
| 35 | + |
|---|
| 36 | +export type PacksFilter = { |
|---|
| 37 | + licenseTypeId?: number; |
|---|
| 38 | + organizationId?: number; |
|---|
| 39 | + applicationId?: number; |
|---|
| 40 | + name?: string; |
|---|
| 34 | 41 | } |
|---|
| 35 | 42 | |
|---|
| 36 | 43 | export const PACK_STATUS = { |
|---|
| .. | .. |
|---|
| 79 | 86 | super($L, http, 'pack'); |
|---|
| 80 | 87 | } |
|---|
| 81 | 88 | |
|---|
| 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 | + |
|---|
| 82 | 96 | public activate(id: number) { |
|---|
| 83 | 97 | return super.action(id, "activate"); |
|---|
| 84 | 98 | } |
|---|