Skip to content

Commit

Permalink
feat: fix post now
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevo David committed Sep 12, 2024
1 parent c754e91 commit 21d5d2c
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ export class PostsService {
`Error posting on ${firstPost.integration?.providerIdentifier} for ${firstPost?.integration?.name}`,
`An error occurred while posting on ${
firstPost.integration?.providerIdentifier
} ${!process.env.NODE_ENV || process.env.NODE_ENV === 'development' ? err : ''}`,
} ${
!process.env.NODE_ENV || process.env.NODE_ENV === 'development'
? err
: ''
}`,
true
);
}
Expand Down Expand Up @@ -390,8 +394,8 @@ export class PostsService {
}

if (
(body.type === 'schedule' || body.type === 'now') &&
dayjs(body.date).isAfter(dayjs())
body.type === 'now' ||
(body.type === 'schedule' && dayjs(body.date).isAfter(dayjs()))
) {
this._workerServiceProducer.emit('post', {
id: posts[0].id,
Expand Down Expand Up @@ -535,11 +539,7 @@ export class PostsService {
async generatePostsDraft(orgId: string, body: CreateGeneratedPostsDto) {
const getAllIntegrations = (
await this._integrationService.getIntegrationsList(orgId)
).filter(
(f) =>
!f.disabled &&
f.providerIdentifier !== 'reddit'
);
).filter((f) => !f.disabled && f.providerIdentifier !== 'reddit');

// const posts = chunk(body.posts, getAllIntegrations.length);
const allDates = dayjs()
Expand Down

0 comments on commit 21d5d2c

Please sign in to comment.