diff --git a/frontend/projects/shared-meet-components/src/lib/services/http.service.ts b/frontend/projects/shared-meet-components/src/lib/services/http.service.ts index f6d514a..6524995 100644 --- a/frontend/projects/shared-meet-components/src/lib/services/http.service.ts +++ b/frontend/projects/shared-meet-components/src/lib/services/http.service.ts @@ -28,6 +28,11 @@ export class HttpService { return lastValueFrom(this.http.put(path, body, options)); } + async patchRequest(path: string, body: any = {}, headers?: Record): Promise { + const options = headers ? { headers: new HttpHeaders(headers) } : {}; + return lastValueFrom(this.http.patch(path, body, options)); + } + async deleteRequest(path: string, headers?: Record): Promise { const options = { observe: 'response' as const, @@ -38,9 +43,4 @@ export class HttpService { statusCode: response.status })); } - - async patchRequest(path: string, body: any = {}, headers?: Record): Promise { - const options = headers ? { headers: new HttpHeaders(headers) } : {}; - return lastValueFrom(this.http.patch(path, body, options)); - } } diff --git a/frontend/projects/shared-meet-components/src/lib/services/meeting.service.ts b/frontend/projects/shared-meet-components/src/lib/services/meeting.service.ts index 524dbdc..f5a9ed1 100644 --- a/frontend/projects/shared-meet-components/src/lib/services/meeting.service.ts +++ b/frontend/projects/shared-meet-components/src/lib/services/meeting.service.ts @@ -52,10 +52,10 @@ export class MeetingService { * @param newRole - The new role to be assigned to the participant */ async changeParticipantRole(roomId: string, participantIdentity: string, newRole: string): Promise { - const path = `${this.MEETINGS_API}/${roomId}/participants/${participantIdentity}`; + const path = `${this.MEETINGS_API}/${roomId}/participants/${participantIdentity}/role`; const headers = this.participantService.getParticipantRoleHeader(); const body = { role: newRole }; - await this.httpService.patchRequest(path, body, headers); + await this.httpService.putRequest(path, body, headers); this.log.d(`Changed role of participant '${participantIdentity}' to '${newRole}' in room '${roomId}'`); } }