Populate user notes from waitlist entry

This commit is contained in:
Remi
2025-10-19 17:35:30 +02:00
parent 4dc273bab3
commit aa50e345a7

View File

@@ -55,6 +55,9 @@ export default defineEventHandler(async (event) => {
throw createError({ statusCode: 400, statusMessage: 'Invitation code has expired' })
}
const waitlistEntry = await WaitlistEntry.findOne({ email }).select('notes')
const waitlistNotes = waitlistEntry?.notes?.trim()
const passwordHash = await hashPassword(password)
const now = new Date()
@@ -64,6 +67,7 @@ export default defineEventHandler(async (event) => {
name,
acceptedPrivacyAt: now,
acceptedTermsAt: now,
...(waitlistNotes ? { adminNotes: waitlistNotes } : {}),
})
invitation.usedBy = user._id