Skip to content

Commit 7fdec0b

Browse files
Fix QueryReminders to cast empty filter array to object for proper JSON encoding
1 parent 980f814 commit 7fdec0b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/GetStream/StreamChat/Client.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1721,8 +1721,10 @@ public function deleteReminder(string $messageId, string $userId): StreamRespons
17211721
*/
17221722
public function queryReminders(string $userId, array $filterConditions = [], ?array $sort = null, array $options = []): StreamResponse
17231723
{
1724+
$filter = !empty($filterConditions) ? $filterConditions : (object)[];
1725+
17241726
$params = array_merge($options, [
1725-
'filter' => $filterConditions,
1727+
'filter' => $filter,
17261728
'sort' => $sort ?? [['field' => 'remind_at', 'direction' => 1]],
17271729
'user_id' => $userId
17281730
]);

0 commit comments

Comments
 (0)