Skip to content
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

fix(backend): await for events to be written #1266

Merged
merged 11 commits into from
Jul 2, 2024
6 changes: 4 additions & 2 deletions backend/src/graphql/resolvers/ContactFormResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import { EVENT_CONTACTFORM_SEND } from '#src/event/Events'
@Resolver()
export class ContactFormResolver {
@Mutation(() => Boolean)
createContactForm(@Arg('contactFormData') contactFormData: ContactFormInput): boolean {
async createContactForm(
@Arg('contactFormData') contactFormData: ContactFormInput,
): Promise<boolean> {
void sendContactEmails(contactFormData)
void EVENT_CONTACTFORM_SEND(contactFormData.email)
await EVENT_CONTACTFORM_SEND(contactFormData.email)
return true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ export class NewsletterSubscriptionResolver {
subscribeToNewsletterData.lastName,
subscribeToNewsletterData.email,
)
void EVENT_NEWSLETTER_SUBSCRIBE(subscribeToNewsletterData.email)
await EVENT_NEWSLETTER_SUBSCRIBE(subscribeToNewsletterData.email)
return result
}

@Mutation(() => Boolean)
async confirmNewsletter(@Arg('code') code: string): Promise<boolean> {
const result = await confirmNewsletter(code)
void EVENT_NEWSLETTER_CONFIRM(result ? result.email : undefined)
await EVENT_NEWSLETTER_CONFIRM(result ? result.email : undefined)
return !!result
}
}