2017-12-28 20:22:50 -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_Appservice } from "../../models/admin-responses";
|
2017-12-28 20:22:50 -05:00
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class AdminAppserviceApiService extends AuthedApi {
|
|
|
|
constructor(http: Http) {
|
|
|
|
super(http);
|
|
|
|
}
|
|
|
|
|
|
|
|
public getAppservices(): Promise<FE_Appservice[]> {
|
|
|
|
return this.authedGet("/api/v1/dimension/admin/appservices/all").map(r => r.json()).toPromise();
|
|
|
|
}
|
2018-01-31 18:30:08 -05:00
|
|
|
|
2018-03-24 14:18:38 -04:00
|
|
|
public getAppservice(appserviceId: string): Promise<FE_Appservice> {
|
|
|
|
return this.authedGet("/api/v1/dimension/admin/appservices/" + appserviceId).map(r => r.json()).toPromise();
|
|
|
|
}
|
|
|
|
|
2018-01-31 18:30:08 -05:00
|
|
|
public createAppservice(userPrefix: string): Promise<FE_Appservice> {
|
|
|
|
return this.authedPost("/api/v1/dimension/admin/appservices/new", {userPrefix: userPrefix}).map(r => r.json()).toPromise();
|
|
|
|
}
|
2018-03-24 14:18:38 -04:00
|
|
|
|
|
|
|
public test(appserviceId: string): Promise<any> {
|
|
|
|
return this.authedPost("/api/v1/dimension/admin/appservices/" + appserviceId + "/test").map(r => r.json()).toPromise();
|
|
|
|
}
|
2017-12-28 20:22:50 -05:00
|
|
|
}
|