|
@@ -17,6 +17,7 @@ import { ChatRoleService } from '../chat-role/chat-role.service'
|
|
|
import { LikesService } from 'src/likes/likes.service'
|
|
import { LikesService } from 'src/likes/likes.service'
|
|
|
import { ChatRole } from 'src/chat-role/entities/chat-role.entity'
|
|
import { ChatRole } from 'src/chat-role/entities/chat-role.entity'
|
|
|
import { Likes } from 'src/likes/entities/likes.entity'
|
|
import { Likes } from 'src/likes/entities/likes.entity'
|
|
|
|
|
+import { el } from 'date-fns/locale'
|
|
|
|
|
|
|
|
@Injectable()
|
|
@Injectable()
|
|
|
export class MomentsService {
|
|
export class MomentsService {
|
|
@@ -55,9 +56,7 @@ export class MomentsService {
|
|
|
const map = await this.chatRoleService.findMapByIds(ids);
|
|
const map = await this.chatRoleService.findMapByIds(ids);
|
|
|
page.items.forEach(c => {
|
|
page.items.forEach(c => {
|
|
|
c.chatRole = map.get(c.userId)
|
|
c.chatRole = map.get(c.userId)
|
|
|
- if (targetIds.includes(c.id)) {
|
|
|
|
|
- c.isLiked = true
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ c.isLiked = targetIds.includes(c.id) ? true : false
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
return page
|
|
return page
|