Skip to content
Snippets Groups Projects
Verified Commit 12a4be70 authored by Lukas Mauß's avatar Lukas Mauß Committed by Lukas Maximilian Kimpel
Browse files

Adjust room list so that the getRooms() distinguishes between participant and creator

parent e2d1936f
1 merge request!87participant home screen api
......@@ -17,7 +17,8 @@ export class RoomListComponent implements OnInit {
constructor(
private roomService: RoomService,
protected authenticationService: AuthenticationService) {}
protected authenticationService: AuthenticationService) {
}
ngOnInit() {
this.getRooms();
......
......@@ -21,7 +21,7 @@ export class RoomService extends ErrorHandlingService {
super();
}
getRooms(): Observable<Room[]> {
getCreatorRooms(): Observable<Room[]> {
const url = this.apiBaseUrl + this.roomsUrl + this.findRoomsUrl;
return this.http.post<Room[]>(url, {
properties: { ownerId: this.authService.getUser().userId },
......@@ -32,6 +32,17 @@ export class RoomService extends ErrorHandlingService {
);
}
getParticipantRooms(): Observable<Room[]> {
const url = this.apiBaseUrl + this.roomsUrl + this.findRoomsUrl;
return this.http.post<Room[]>(url, {
properties: {},
externalFilters: { inHistoryOfUserId: this.authService.getUser().userId }
}).pipe(
tap(_ => ''),
catchError(this.handleError('getRooms', []))
);
}
addRoom(room: Room): Observable<Room> {
const connectionUrl = this.apiBaseUrl + this.roomsUrl + '/';
return this.http.post<Room>(connectionUrl, {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment