Merge pull request #44 from chrisbenseler/main
This commit is contained in:
commit
b7d9f85eab
3 changed files with 10 additions and 10 deletions
|
@ -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
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,10 @@ export default function Home(props) {
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return <p className="text-gray-400">Loading...</p>;
|
return <p className="text-gray-400">Loading...</p>;
|
||||||
} else {
|
}
|
||||||
if (!session) {
|
if (!session) {
|
||||||
window.location.href = "/auth/login";
|
window.location.href = "/auth/login";
|
||||||
}
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return(
|
return(
|
||||||
|
|
Loading…
Reference in a new issue