From c75ca1c2d6193576fb368a8edaaf06cab33f5d71 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 26 Jun 2019 12:10:24 +0200 Subject: [PATCH] fix lint and encode path params properly --- src/base-apis.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/base-apis.js b/src/base-apis.js index a495efe07..9c11d8ece 100644 --- a/src/base-apis.js +++ b/src/base-apis.js @@ -446,12 +446,16 @@ MatrixBaseApis.prototype.fetchRelations = queryParams.from = opts.token; } const queryString = utils.encodeParams(queryParams); + const path = utils.encodeUri( + "/rooms/$roomId/relations/$eventId/$relationType/$eventType?" + queryString, { + $roomId: roomId, + $eventId: eventId, + $relationType: relationType, + $eventType: eventType, + }); // valid options include: room_alias_name, visibility, invite const response = await this._http.authedRequestWithPrefix( - undefined, - "GET", - `/rooms/${roomId}/relations/${eventId}/${relationType}/${eventType}?` + queryString, - null, null, httpApi.PREFIX_UNSTABLE, + undefined, "GET", path, null, null, httpApi.PREFIX_UNSTABLE, ); return response; };