Skip to content

Commit 5efa408

Browse files
author
Shunsuke Watanabe
committed
remove member property from search mini response tejimaya#10
1 parent da8d885 commit 5efa408

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

apps/api/modules/communityTopic/templates/searchSuccess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
foreach ($topics as $topic)
1010
{
11-
$_topic = op_api_community_topic($topic);
11+
$_topic = op_api_community_topic_mini($topic);
1212
$comments = $topic->getCommunityTopicComment();
1313
$_topic['latest_comment'] = '';
1414
if(count($comments))

lib/helper/opCommunityTopicHelper.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,19 @@ function op_api_community_topic($topic)
5353
);
5454
}
5555

56+
function op_api_community_topic_mini($topic)
57+
{
58+
return array(
59+
'id' => $topic->getId(),
60+
'community_id' => $topic->getCommunityId(),
61+
'community_name' => $topic->getCommunity()->getName(),
62+
'name' => $topic->getName(),
63+
'body' => nl2br($topic->getBody()),
64+
'created_at' => $topic->getCreatedAt(),
65+
'ago' => op_format_activity_time(strtotime($topic->getTopicUpdatedAt())),
66+
);
67+
}
68+
5669
function op_api_community_topic_comment($comment)
5770
{
5871
return array(

0 commit comments

Comments
 (0)