diff --git a/src/app/room-list/room-list.component.ts b/src/app/room-list/room-list.component.ts index 83c3ada7cfa81a0f733dbdd003b5700c4d0bf27a..9e0dd6e4a902818b2804f661f87468b0f268cce7 100644 --- a/src/app/room-list/room-list.component.ts +++ b/src/app/room-list/room-list.component.ts @@ -17,7 +17,8 @@ export class RoomListComponent implements OnInit { constructor( private roomService: RoomService, - protected authenticationService: AuthenticationService) {} + protected authenticationService: AuthenticationService) { + } ngOnInit() { this.getRooms(); diff --git a/src/app/room.service.ts b/src/app/room.service.ts index a479c71b17490370b17786e527d720c8cf053f84..e293c6d33148787ca7ea6006a8395c36ec6d0775 100644 --- a/src/app/room.service.ts +++ b/src/app/room.service.ts @@ -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, {