matrix-dimension/web/app/shared/services/AuthedApi.ts
2017-12-22 21:11:27 -07:00

15 lines
430 B
TypeScript

import { Http, Response } from "@angular/http";
import { Observable } from "rxjs/Observable";
import { SessionStorage } from "../SessionStorage";
export class AuthedApi {
constructor(protected http: Http) {
}
protected authedGet(url: string, qs?: any): Observable<Response> {
if (!qs) qs = {};
qs["scalar_token"] = SessionStorage.scalarToken;
return this.http.get(url, {params: qs});
}
}