amkacheck-service.ts 995 Bytes
Newer Older
Open Source Developer's avatar
Open Source Developer committed
1
2
3
4
import {Http,Response, RequestOptions, Headers} from '@angular/http';
import {Injectable} from '@angular/core';
import {Observable} from "rxjs/Observable";
import 'rxjs/add/operator/map';
Open Source Developer's avatar
a    
Open Source Developer committed
5
import { IAmkaFill } from '../store/amkafill/amkafills.types';
Open Source Developer's avatar
Open Source Developer committed
6

Open Source Developer's avatar
commit    
Open Source Developer committed
7

Open Source Developer's avatar
Open Source Developer committed
8
9
10
@Injectable()
export class AmkaCheckService {
    private _url = "https://wso2.minedu.gov.gr/amka/v1.1/" ;
Open Source Developer's avatar
a    
Open Source Developer committed
11
    private respond :Object
Open Source Developer's avatar
Open Source Developer committed
12
13
14
15
16
17
18
19
20
21
22
23
    constructor(private _http: Http) {
    };

    checkstudentamka(amka: any) {
        let authToken = '7bed3fc5-f9f5-3613-abcd-3b08bab0f625';
        let headers = new Headers({ 'Accept': 'application/json' });
        headers.append('Authorization', `Bearer ${authToken}`);

        let options = new RequestOptions({headers : headers});

        let parameter1 = 'ksdhkshf' ;
        
Open Source Developer's avatar
a    
Open Source Developer committed
24
25
26
27
        this._http.get(this._url+ amka.name +'/'+ parameter1 ,options)
            .map(response =><IAmkaFill[]>response.json() )
            .subscribe(res =>this.respond = res);
        return this.respond;
Open Source Developer's avatar
Open Source Developer committed
28
29
30

    }
}