Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Support avatar during register API
Browse files Browse the repository at this point in the history
  • Loading branch information
joesaunderson committed Apr 5, 2022
1 parent 99cd3c5 commit 28c63e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pages/api/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
origin: '*',
})

const { token, organizationId, firstName, lastName } = JSON.parse(req.body)
const { token, organizationId, firstName, lastName, avatar } = JSON.parse(req.body)

if (!organizationId || !token) {
res.status(400).json({ error: 'Missing required fields' })
Expand All @@ -45,6 +45,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
.insert({
first_name: firstName,
last_name: lastName,
avatar,
})
.limit(1)
.single()
Expand Down Expand Up @@ -93,6 +94,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
profileId: userProfile.id,
firstName,
lastName,
avatar,
organizationId: organizationId,
})
}
Expand Down

0 comments on commit 28c63e2

Please sign in to comment.