Skip to content

Commit

Permalink
Update post.service.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
RiXelanya committed Nov 15, 2023
1 parent 43638da commit 0fc9c60
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/services/post.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
DraftPost,
Experience,
ExperiencePost,
ExperienceRelations,
ExtendedPost,
Friend,
People,
Expand Down Expand Up @@ -747,7 +746,7 @@ export class PostService {
}

private async getVisibility(userId: string, timelineIds = [] as string[]) {
const timeline = this.experienceRepository.find({
const timelineUser = this.experienceRepository.find({
where: {
id: {inq: timelineIds},
createdBy: userId,
Expand All @@ -761,14 +760,14 @@ export class PostService {
},
})
.then(res => {
const query = res.map(res => res.userId);
const query = res.map(result => result.userId);
return this.experienceRepository.find({
where: {
id: {inq: query},
},
});
});
const timelines = await Promise.all([timeline, editable]).then(res => {
const timelines = await Promise.all([timelineUser, editable]).then(res => {
return [...res[0], ...res[1]];
});

Expand Down

0 comments on commit 0fc9c60

Please sign in to comment.