2017-12-28 20:22:50 -05:00
|
|
|
import { Injectable } from "@angular/core";
|
2018-03-24 19:16:52 -04:00
|
|
|
import { AuthedApi } from "../authed-api";
|
|
|
|
import { FE_Appservice } from "../../models/admin-responses";
|
2019-06-29 02:21:56 -04:00
|
|
|
import { HttpClient } from "@angular/common/http";
|
2017-12-28 20:22:50 -05:00
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class AdminAppserviceApiService extends AuthedApi {
|
2019-06-29 02:21:56 -04:00
|
|
|
constructor(http: HttpClient) {
|
2017-12-28 20:22:50 -05:00
|
|
|
super(http);
|
|
|
|
}
|
|
|
|
|
|
|
|
public getAppservices(): Promise<FE_Appservice[]> {
|
2019-06-29 02:21:56 -04:00
|
|
|
return this.authedGet<FE_Appservice[]>("/api/v1/dimension/admin/appservices/all").toPromise();
|
2017-12-28 20:22:50 -05:00
|
|
|
}
|
2018-01-31 18:30:08 -05:00
|
|
|
|
2018-03-24 14:18:38 -04:00
|
|
|
public getAppservice(appserviceId: string): Promise<FE_Appservice> {
|
2019-06-29 02:21:56 -04:00
|
|
|
return this.authedGet<FE_Appservice>("/api/v1/dimension/admin/appservices/" + appserviceId).toPromise();
|
2018-03-24 14:18:38 -04:00
|
|
|
}
|
|
|
|
|
2018-01-31 18:30:08 -05:00
|
|
|
public createAppservice(userPrefix: string): Promise<FE_Appservice> {
|
2019-06-29 02:21:56 -04:00
|
|
|
return this.authedPost<FE_Appservice>("/api/v1/dimension/admin/appservices/new", {userPrefix: userPrefix})
|
|
|
|
.toPromise();
|
2018-01-31 18:30:08 -05:00
|
|
|
}
|
2018-03-24 14:18:38 -04:00
|
|
|
|
|
|
|
public test(appserviceId: string): Promise<any> {
|
2019-06-29 02:21:56 -04:00
|
|
|
return this.authedPost("/api/v1/dimension/admin/appservices/" + appserviceId + "/test").toPromise();
|
2018-03-24 14:18:38 -04:00
|
|
|
}
|
2017-12-28 20:22:50 -05:00
|
|
|
}
|