-delen van agenda toegevoegd -popup aangepast -accepteren van uitnodiging toegevoegd
33 lines
984 B
TypeScript
33 lines
984 B
TypeScript
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<any> {
|
|
return this.http.post(`${this.baseApi}/${email}`, {url});
|
|
}
|
|
|
|
createInvite(companyId: number, email: string): Observable<InviteEntity> {
|
|
return this.http.post<InviteEntity>(`${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<any> {
|
|
return this.http.post(this.baseApi + `/link?user=${user}&company=${company}`, {})
|
|
}
|
|
}
|