1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-09 10:22:46 +03:00

fix public rooms post request search params and body (#4110)

This commit is contained in:
Ajay Bura
2024-03-21 15:59:51 +05:30
committed by GitHub
parent d5bb9e7600
commit dc2d03dea5

View File

@@ -8457,11 +8457,17 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
since,
...options
}: IRoomDirectoryOptions = {}): Promise<IPublicRoomsResponse> {
const queryParams: QueryDict = { server, limit, since };
if (Object.keys(options).length === 0) {
const queryParams: QueryDict = { server, limit, since };
return this.http.authedRequest(Method.Get, "/publicRooms", queryParams);
} 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);
}
}