You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-10 21:23:02 +03:00
fix public rooms post request search params and body (#4110)
This commit is contained in:
@@ -8457,11 +8457,17 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
|||||||
since,
|
since,
|
||||||
...options
|
...options
|
||||||
}: IRoomDirectoryOptions = {}): Promise<IPublicRoomsResponse> {
|
}: IRoomDirectoryOptions = {}): Promise<IPublicRoomsResponse> {
|
||||||
const queryParams: QueryDict = { server, limit, since };
|
|
||||||
if (Object.keys(options).length === 0) {
|
if (Object.keys(options).length === 0) {
|
||||||
|
const queryParams: QueryDict = { server, limit, since };
|
||||||
return this.http.authedRequest(Method.Get, "/publicRooms", queryParams);
|
return this.http.authedRequest(Method.Get, "/publicRooms", queryParams);
|
||||||
} else {
|
} else {
|
||||||
return this.http.authedRequest(Method.Post, "/publicRooms", queryParams, options);
|
const queryParams: QueryDict = { server };
|
||||||
|
const body = {
|
||||||
|
limit,
|
||||||
|
since,
|
||||||
|
...options,
|
||||||
|
};
|
||||||
|
return this.http.authedRequest(Method.Post, "/publicRooms", queryParams, body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user