Add simple user model

This commit is contained in:
Kurt Hutten
2020-10-19 19:33:08 +11:00
parent d5c3e3bc10
commit f4e16dc209
25 changed files with 1048 additions and 2 deletions

View File

@@ -0,0 +1,35 @@
import { createUser } from 'src/services/users/users.js'
export const handler = async (req, _context) => {
const body = JSON.parse(req.body)
console.log(body)
console.log(_context)
const eventType = body.event
const user = body.user
const email = user.email
let roles = []
if (eventType === 'signup') {
roles.push('user')
const hi = {
email: 'kurt.hutten@gmail.com',
image: '',
bio: ''
}
const input = {
email,
}
createUser({input})
return {
statusCode: 200,
body: JSON.stringify({ app_metadata: { roles: roles } }),
}
} else {
return {
statusCode: 200,
}
}
}