Update 0.0.3:
-delen van agenda toegevoegd -popup aangepast -accepteren van uitnodiging toegevoegd
This commit is contained in:
32
src/app/services/agenda.service.ts
Normal file
32
src/app/services/agenda.service.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
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}`, {})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user