refactor: using property assignment
This commit is contained in:
parent
0d35bcfe38
commit
501f229d0e
3 changed files with 3511 additions and 6 deletions
3505
package-lock.json
generated
Normal file
3505
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -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
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -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
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue