Skip to content

Commit

Permalink
Bugfix: Use query params for Channel::getMessages instead of json body
Browse files Browse the repository at this point in the history
  • Loading branch information
Naneynonn authored Jul 21, 2024
1 parent 2ede7cd commit 391b19b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/Rest/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,18 @@ public function getMessages(
string $channelId,
GetMessagesBuilder $getMessagesBuilder = new GetMessagesBuilder()
): ExtendedPromiseInterface {
$endpoint = Endpoint::bind(
Endpoint::CHANNEL_MESSAGES,
$channelId
);

$queryParams = $getMessagesBuilder->get();
foreach ($queryParams as $key => $value) {
$endpoint->addQuery($key, $value);
}

return $this->mapArrayPromise(
$this->http->get(
Endpoint::bind(
Endpoint::CHANNEL_MESSAGES,
$channelId
),
$getMessagesBuilder->get()
),
$this->http->get($endpoint),
Message::class
)->otherwise($this->logThrowable(...));
}
Expand Down

0 comments on commit 391b19b

Please sign in to comment.