File

src/app/admin/invites/invites.service.ts

Index

Methods

Constructor

constructor(http: AuthHttp)
Parameters :
Name Type Optional Description
http AuthHttp

Methods

createCompany
createCompany(company: Company)
Parameters :
Name Type Optional Description
company Company
Returns : any
createInvite
createInvite(invite: Invite)
Parameters :
Name Type Optional Description
invite Invite
Returns : any
getCompanies
getCompanies()
Returns : any
getInvites
getInvites()
Returns : any
getInvitesByCompany
getInvitesByCompany()
Returns : any
getRoles
getRoles()
Returns : any
removeInvite
removeInvite(id: number)
Parameters :
Name Type Optional Description
id number
Returns : any
import {Injectable} from "@angular/core";
import {Invite} from "./invite.model";
import {AuthHttp} from "../../core/auth/auth-http.service";
import {Company} from "../../core/models/auth/company.model";


@Injectable()
export class InvitesService {

  constructor(private http: AuthHttp) {
  }

  getRoles() {
    return this.http.get("/auth/api/v1/roles/all").map(response => response.json())
  }

  createInvite(invite: Invite) {
    return this.http.post("/auth/invite", JSON.stringify(invite))
  }

  getInvites() {
    return this.http.get("/auth/api/v1/invites/all").map(response => response.json())
  }

  getInvitesByCompany() {
    return this.http.get("/auth/api/v1/invites/company").map(response => response.json())
  }

  getCompanies() {
    return this.http.get("auth/api/v1/companies/all").map(response => response.json())
  }

  createCompany(company: Company) {
    return this.http.post("auth/api/v1/companies/create", JSON.stringify(company)).map(response => response.json())
  }

  removeInvite(id: number) {
    return this.http.delete("auth/api/v1/invites/" + id)
  }

}

results matching ""

    No results matching ""