add invites

This commit is contained in:
_Bastler
2021-05-06 21:26:57 +02:00
parent 3e02cbb353
commit c8a10eb73c
12 changed files with 1213 additions and 892 deletions
+35
View File
@@ -0,0 +1,35 @@
import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {environment} from '../../environments/environment';
@Injectable({
providedIn: 'root',
})
export class InviteService {
constructor(private http: HttpClient) {
}
get(quota: string) {
return this.http.get(environment.apiUrl + "/invites" + (quota ? "?quota=" + quota : ""));
}
getOthers(quota: string) {
return this.http.get(environment.apiUrl + "/invites/" + quota + "/others");
}
getOthersPages(quota: string, page : number, size : number, search : string) {
return this.http.get(environment.apiUrl + "/invites/" + quota + "/others?page=" + page + "&size=" + size + "&search=" + search);
}
create(quota: string, invite: any) {
return this.http.post(environment.apiUrl + "/invites/" + quota, invite);
}
update(invite: any) {
return this.http.post(environment.apiUrl + "/invites", invite);
}
}