Skip to content

Commit

Permalink
Merge pull request activepieces#5323 from activepieces/fix/invitation…
Browse files Browse the repository at this point in the history
…-link

chore: address comments on fix/invitation-link branch
  • Loading branch information
AbdulTheActivePiecer authored Aug 11, 2024
2 parents e284963 + 0657029 commit d637adb
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const userInvitationsService = {
const platform = await platformService.getOneOrThrow(platformId)

if (!isNil(invitation)) {
return handleInvitationLink({ platform, userInvitation: invitation })
return enrichWithInvitationLink( platform, invitation )
}
const id = apId()
await repo().upsert({
Expand All @@ -105,7 +105,7 @@ export const userInvitationsService = {
platformId,
})

return handleInvitationLink({ platform, userInvitation })
return enrichWithInvitationLink( platform, userInvitation )
},
async list(params: ListUserParams): Promise<SeekPage<UserInvitation>> {
const decodedCursor = paginationHelper.decodeCursor(params.cursor ?? null)
Expand Down Expand Up @@ -208,7 +208,7 @@ async function generateInvitationLink(userInvitation: UserInvitation): Promise<s
path: `invitation?token=${token}&email=${encodeURIComponent(userInvitation.email)}`,
})
}
const handleInvitationLink = async ({ platform, userInvitation }: { platform: Platform, userInvitation: UserInvitation }) => {
const enrichWithInvitationLink = async ( platform: Platform, userInvitation: UserInvitation ) => {
const invitationLink = await generateInvitationLink(userInvitation)
if (!smtpEmailSender.isSmtpConfigured(platform)) {
return {
Expand Down

0 comments on commit d637adb

Please sign in to comment.