feat: pre-registrant management and invitation system
Admin interface to review, filter, and batch-invite the 95 pre-registrants from Baby Ghosts. Accept-invitation page pre-fills their data and collects circle, pronouns, motivation, contribution tier, and agreement before creating their member record.
This commit is contained in:
parent
bab53cec9e
commit
501be10bfe
15 changed files with 1896 additions and 1 deletions
16
server/api/admin/pre-registrants/bulk-status.patch.js
Normal file
16
server/api/admin/pre-registrants/bulk-status.patch.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import PreRegistration from '../../../models/preRegistration.js'
|
||||
import { connectDB } from '../../../utils/mongoose.js'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
await requireAdmin(event)
|
||||
const { ids, status } = await validateBody(event, preRegistrantBulkStatusSchema)
|
||||
await connectDB()
|
||||
|
||||
// Only update pre-registrants that aren't already accepted
|
||||
const result = await PreRegistration.updateMany(
|
||||
{ _id: { $in: ids }, status: { $nin: ['accepted'] } },
|
||||
{ $set: { status } }
|
||||
)
|
||||
|
||||
return { modified: result.modifiedCount, total: ids.length }
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue