refactor: using property assignment

This commit is contained in:
Chris Benseler 2021-04-17 17:12:09 -03:00
parent 0d35bcfe38
commit 501f229d0e
3 changed files with 3511 additions and 6 deletions

3505
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -37,8 +37,8 @@ export default async function handler(req, res) {
const user = await prisma.user.create({ const user = await prisma.user.create({
data: { data: {
username: username, username,
email: email, email,
password: hashedPassword password: hashedPassword
} }
}); });

View file

@ -25,16 +25,16 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const username = req.body.username; const username = req.body.username;
const name = req.body.name; const name = req.body.name;
const description = req.body.description; const bio = req.body.description;
const updateUser = await prisma.user.update({ const updateUser = await prisma.user.update({
where: { where: {
id: user.id, id: user.id,
}, },
data: { data: {
username: username, username,
name: name, name,
bio: description bio
}, },
}); });