matrix-dimension/web/app/shared/services/admin/admin-appservice-api.service.ts
Travis Ralston 74054c3962 Add ability to create self-hosted go-neb instances
They can't be provisioned or configured correctly yet, but they exist.
2018-01-31 16:30:08 -07:00

20 lines
700 B
TypeScript

import { Injectable } from "@angular/core";
import { Http } from "@angular/http";
import { AuthedApi } from "../AuthedApi";
import { FE_Appservice } from "../../models/admin_responses";
@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();
}
public createAppservice(userPrefix: string): Promise<FE_Appservice> {
return this.authedPost("/api/v1/dimension/admin/appservices/new", {userPrefix: userPrefix}).map(r => r.json()).toPromise();
}
}