diff --git a/src/app/authentication.interceptor.ts b/src/app/authentication.interceptor.ts index 071cba6ae663016ab49bd4fcf16ead90792b2df7..98b085c4e707d897c6b32d2cb3f06816f5406067 100644 --- a/src/app/authentication.interceptor.ts +++ b/src/app/authentication.interceptor.ts @@ -8,6 +8,8 @@ import { Observable } from 'rxjs/Observable'; const AUTH_HEADER_KEY = 'Arsnova-Auth-Token'; +const AUTH_HEADER_KEY = 'Arsnova-Auth-Token'; + @Injectable() export class AuthenticationInterceptor implements HttpInterceptor { diff --git a/src/app/room.service.ts b/src/app/room.service.ts index 1c9f0c68b1f4138879acb305a0c3afd41b8014bd..b48f9dcec1699fd279bf943b4152cff3d6aff6e4 100644 --- a/src/app/room.service.ts +++ b/src/app/room.service.ts @@ -14,7 +14,8 @@ const httpOptions = { export class RoomService extends ErrorHandlingService { private roomsUrl = 'api/rooms'; - constructor(private http: HttpClient) { + constructor(private http: HttpClient, + private authenticationService: AuthenticationService) { super(); } @@ -25,6 +26,17 @@ export class RoomService extends ErrorHandlingService { ); } + getRoomsCreator(): Observable<Room[]> { + const getRoomsUrl = 'https://arsnova-staging.mni.thm.de/api/room/find'; + + return this.http.post<Room[]>(getRoomsUrl, { + properties: {}, + externalFilters: { + ownerId: this.authenticationService.getUser().userId + } + }, httpOptions); + } + addRoom(room: Room): Observable<Room> { return this.http.post<Room>(this.roomsUrl, room, httpOptions).pipe( tap(_ => ''),