Skip to content

Commit

Permalink
chore(api): fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
khaledmashaly committed Feb 27, 2024
1 parent 8cbe208 commit e5efd0e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Expand Up @@ -51,6 +51,6 @@ export type EmailTemplateData =

type SendArgs = {
email: string
platformId: string | null
platformId: string | undefined
templateData: EmailTemplateData
}
Expand Up @@ -33,7 +33,7 @@ export const smtpEmailSender: EmailSender = {
},
}

const getPlatform = async (platformId: string | null): Promise<Platform | null> => {
const getPlatform = async (platformId: string | undefined): Promise<Platform | null> => {
return platformId ? platformService.getOne(platformId) : null
}

Expand Down
9 changes: 4 additions & 5 deletions packages/server/api/src/app/ee/helper/email/email-service.ts
Expand Up @@ -5,7 +5,6 @@ import { getEdition } from '../../../helper/secret-helper'
import { projectService } from '../../../project/project-service'
import { platformDomainHelper } from '../platform-domain-helper'
import { jwtUtils } from '../../../helper/jwt-utils'
import { ProjectMemberToken } from '../../project-members/project-member.service'
import { EmailTemplateData, emailSender } from './email-sender/email-sender'

const EDITION = getEdition()
Expand Down Expand Up @@ -36,7 +35,7 @@ export const emailService = {

await emailSender.send({
email,
platformId: project.platformId ?? null,
platformId: project.platformId,
templateData: {
name: 'invitation-email',
vars: {
Expand All @@ -62,7 +61,7 @@ export const emailService = {

await emailSender.send({
email,
platformId: project.platformId || null,
platformId: project.platformId,
templateData: {
name: templateName,
vars: {
Expand All @@ -73,7 +72,7 @@ export const emailService = {
})
},

async sendOtpEmail({ platformId, user, otp, type }: SendOtpArgs): Promise<void> {
async sendOtp({ platformId, user, otp, type }: SendOtpArgs): Promise<void> {
if (EDITION_IS_NOT_PAID) {
return
}
Expand Down Expand Up @@ -118,7 +117,7 @@ export const emailService = {

await emailSender.send({
email: user.email,
platformId,
platformId: platformId ?? undefined,
templateData: otpToTemplate[type],
})
},
Expand Down
2 changes: 1 addition & 1 deletion packages/server/api/src/app/ee/otp/otp-service.ts
Expand Up @@ -36,7 +36,7 @@ export const otpService = {
state: OtpState.PENDING,
}
await repo.upsert(newOtp, ['userId', 'type'])
await emailService.sendOtpEmail({
await emailService.sendOtp({
platformId,
user,
otp: newOtp.value,
Expand Down

0 comments on commit e5efd0e

Please sign in to comment.