Skip to content

Commit

Permalink
chore: code style
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Sep 30, 2024
1 parent e025ecb commit 61fa3a1
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions apps/core/src/modules/activity/activity.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,23 +132,18 @@ export class ActivityController {
const { objects } = await this.service.getRefsFromRoomNames(roomInfo.rooms)

for (const type in objects) {
objects[type] = objects[type].map(pickUsageField)
}

function pickUsageField(item) {
// skip if model is recently
if (!item.title) return item

return pick(item, [
'title',
'slug',
'cover',
'created',
'category',
'categoryId',
'id',
'nid',
])
objects[type] = objects[type].map((item) => {
return pick(item, [
'title',
'slug',
'cover',
'created',
'category',
'categoryId',
'id',
'nid',
])
})
}

return {
Expand Down

0 comments on commit 61fa3a1

Please sign in to comment.