user creation and invites

This commit is contained in:
2025-06-24 16:31:13 -04:00
parent 23c8f468fe
commit a659401bde
32 changed files with 667 additions and 30 deletions

View File

@@ -1,4 +1,5 @@
import { prisma } from './prisma';
import bcrypt from 'bcrypt'
export const mutations = {
async createEvent(data: {
@@ -30,5 +31,30 @@ export const mutations = {
email: data.email,
},
});
}
},
async createUser({
username,
email,
password,
role,
}: {
username: string
email?: string
password: string
role: 'COUPLE' | 'PLANNER' | 'GUEST'
}) {
const hashedPassword = await bcrypt.hash(password, 10)
const user = await prisma.user.create({
data: {
username,
email: email || '',
password: hashedPassword,
role,
},
})
return user
},
};