import {Injectable} from '@angular/core'; import {environment} from '../../environments/environment'; import {HttpClient} from '@angular/common/http'; import {Observable} from 'rxjs'; import {InviteEntity} from '../models/invite-entity'; @Injectable({ providedIn: 'root' }) export class AgendaService { baseApi = `${environment.baseApi}/agenda`; constructor(private http: HttpClient) { } sendInvite(url: string, email: string): Observable { return this.http.post(`${this.baseApi}/${email}`, {url}); } createInvite(companyId: number, email: string): Observable { return this.http.post(`${this.baseApi}/createinvite`, {companyId: companyId, email: email}); } verifyInvite(token: string) { return this.http.get(this.baseApi + `/verify?token=${token}`, {}) } acceptInvite(user: number, company: number): Observable { return this.http.post(this.baseApi + `/link?user=${user}&company=${company}`, {}) } }