-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: New project events #1874
feat: New project events #1874
Conversation
} | ||
|
||
export async function down(): Promise<void> { | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't you remove those event types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not recommended to do that (check here)
@@ -209,6 +210,7 @@ export async function finishProposal() { | |||
BadgesService.giveFinishProposalBadges(proposalsWithOutcome) | |||
DiscourseService.commentFinishedProposals(proposalsWithOutcome) | |||
DiscordService.notifyFinishedProposals(proposalsWithOutcome) | |||
await EventsService.proposalFinished(proposalsWithOutcome) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to await this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not? it's an async method
@@ -306,6 +306,7 @@ export class ProposalService { | |||
const project = await ProjectService.getUpdatedProject(proposal.project_id!) | |||
updatedProposal.project_status = project.status | |||
NotificationService.projectProposalEnacted(proposal) | |||
await EventsService.projectEnacted(project) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, no need for await
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's also an async method 🤔
@@ -354,6 +359,43 @@ export class EventsService { | |||
} | |||
} | |||
|
|||
static async proposalFinished(proposalsWithOutcome: ProposalWithOutcome[]) { | |||
for (const proposal of proposalsWithOutcome) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we should try catch inside the for... wdyt?
This closes #1776