import { Injectable } from "@angular/core"; import { Api } from "./api"; import { Account, AccountUser, LinkedAccount } from "../../public-api"; /** * Exposes the User endpoint * */ @Injectable({ providedIn: 'root' }) export class AccountService { get route() { return this.api.base + 'account' } constructor(private api: Api) { } get() { return this.api.get(this.route + '/token') } getByID(id: string) { return this.api.get(this.route + id) } getUnverified() { return this.api.get(this.route + '/linkedaccounts/unverified') } post(account: Account) { return this.api.post(this.route, account) } put(account: Account) { return this.api.put(this.route, account) } postUser(users: Array) { return this.api.post>(this.route + '/accountuser', users) } postLinkedAccount(account: LinkedAccount) { return this.api.post(this.route + '/linkedAccount', account) } }