2017-12-24 04:02:57 -05:00
|
|
|
import { Injectable } from "@angular/core";
|
|
|
|
import { Http } from "@angular/http";
|
2018-03-24 19:16:52 -04:00
|
|
|
import { AuthedApi } from "../authed-api";
|
|
|
|
import { FE_DimensionConfig, FE_DimensionVersion } from "../../models/admin-responses";
|
2017-12-24 04:02:57 -05:00
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class AdminApiService extends AuthedApi {
|
|
|
|
constructor(http: Http) {
|
|
|
|
super(http);
|
|
|
|
}
|
|
|
|
|
|
|
|
public isAdmin(): Promise<any> {
|
|
|
|
return this.authedGet("/api/v1/dimension/admin/check").map(r => r.json()).toPromise();
|
|
|
|
}
|
|
|
|
|
|
|
|
public getConfig(): Promise<FE_DimensionConfig> {
|
|
|
|
return this.authedGet("/api/v1/dimension/admin/config").map(r => r.json()).toPromise();
|
|
|
|
}
|
|
|
|
|
|
|
|
public getVersion(): Promise<FE_DimensionVersion> {
|
|
|
|
return this.authedGet("/api/v1/dimension/admin/version").map(r => r.json()).toPromise();
|
|
|
|
}
|
|
|
|
}
|