diff --git a/src/Ushahidi/Modules/V5/Repository/Message/EloquentMessageRepository.php b/src/Ushahidi/Modules/V5/Repository/Message/EloquentMessageRepository.php index 6070f2a1c3..f7ef914bf9 100644 --- a/src/Ushahidi/Modules/V5/Repository/Message/EloquentMessageRepository.php +++ b/src/Ushahidi/Modules/V5/Repository/Message/EloquentMessageRepository.php @@ -52,6 +52,10 @@ private function setSearchCondition(MessageSearchFields $search_fields, $builder $builder->where('messages.contact_id', '=', $search_fields->contact()); } + if ($search_fields->post()) { + $builder->where('messages.post_id', '=', $search_fields->post()); + } + if ($search_fields->type()) { $builder->where('messages.type', '=', $search_fields->type()); }