@@ -186,6 +186,8 @@ export class ActivityController {
|
||||
likeData.type = CollectionRefTypes.Post
|
||||
likeData.slug = item.ref.slug
|
||||
}
|
||||
|
||||
likeData.title = item.ref.title
|
||||
transformedLike.push(likeData)
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import { CountingService } from '~/processors/helper/helper.counting.service'
|
||||
import { EventManagerService } from '~/processors/helper/helper.event.service'
|
||||
import { InjectModel } from '~/transformers/model.transformer'
|
||||
import { transformDataToPaginate } from '~/transformers/paginate.transformer'
|
||||
import { getAvatar } from '~/utils'
|
||||
|
||||
import { CommentService } from '../comment/comment.service'
|
||||
import { Activity } from './activity.constant'
|
||||
@@ -502,7 +503,7 @@ export class ActivityService implements OnModuleInit, OnModuleDestroy {
|
||||
})
|
||||
|
||||
.populate('ref', 'title nid slug category')
|
||||
.lean()
|
||||
.lean({ getters: true })
|
||||
.sort({
|
||||
created: -1,
|
||||
})
|
||||
@@ -510,9 +511,9 @@ export class ActivityService implements OnModuleInit, OnModuleDestroy {
|
||||
return docs.map((doc) => {
|
||||
return Object.assign(
|
||||
{},
|
||||
pick(doc, 'created', 'author', 'text'),
|
||||
pick(doc, 'created', 'author', 'text', 'avatar'),
|
||||
doc.ref,
|
||||
|
||||
!doc.avatar ? { avatar: getAvatar(doc.mail) } : {},
|
||||
{
|
||||
type:
|
||||
'nid' in doc.ref
|
||||
|
||||
@@ -61,8 +61,10 @@ export interface RecentComment {
|
||||
text: string
|
||||
id: string
|
||||
title: string
|
||||
slug: string
|
||||
slug?: string
|
||||
type: string
|
||||
avatar: string
|
||||
nid?: string
|
||||
}
|
||||
|
||||
export interface RecentLike {
|
||||
@@ -71,6 +73,7 @@ export interface RecentLike {
|
||||
type: CollectionRefTypes.Post | CollectionRefTypes.Note
|
||||
nid?: number
|
||||
slug?: string
|
||||
title: string
|
||||
}
|
||||
|
||||
export interface RecentNote {
|
||||
|
||||
Reference in New Issue
Block a user