Skip to content

Commit

Permalink
fix: validateEvent on webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
h4l-yup committed Mar 12, 2024
1 parent 4a2bac5 commit 9cef74a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class WebhookService {
EventTypeEnum.ISSUE_STATUS_CHANGE,
].includes(event.type)
) {
return !event.channelIds;
return !event.channelIds || event.channelIds.length === 0;
}

return false;
Expand Down Expand Up @@ -103,11 +103,6 @@ export class WebhookService {
});

return await this.repository.save(newWebhook);

// const savedEvents = await this.eventRepo.save(events);
// savedWebhook.events = savedEvents;

// return savedWebhook;
}

async findById(webhookId: number) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ export class FeedbackIssueStatisticsService {
where: { id: projectId },
});
const timezoneOffset = timezone.offset;

const cronHour = (24 - Number(timezoneOffset.split(':')[0])) % 24;

const job = new CronJob(`2 ${cronHour} * * *`, async () => {
if (
await this.schedulerLockService.acquireLock(
Expand Down

0 comments on commit 9cef74a

Please sign in to comment.