Changed settings layout + separated settings into different pages. Cleaned some code. Working on tts pages (no db/rest calls yet).

This commit is contained in:
Tom
2023-12-31 10:41:55 +00:00
parent 8eb9b9096f
commit a3352af981
20 changed files with 1083 additions and 287 deletions

View File

@@ -29,16 +29,10 @@ export async function POST(req: Request) {
});
if (exist) {
// const apikey = await db.apiKey.findFirst({
// where: {
// userId: user.toLowerCase() as string
// }
// })
return {
return NextResponse.json({
id: exist.id,
username: exist.username,
//key: apikey?.id as string
};
username: exist.username
});
}
const newUser = await db.user.create({
@@ -47,18 +41,9 @@ export async function POST(req: Request) {
}
});
// const apikey = await db.apiKey.create({
// data: {
// id: generateToken(),
// label: "Default",
// userId: user.toLowerCase() as string
// }
// })
return NextResponse.json({
id: newUser.id,
username: newUser.username,
//key: apikey.id
username: newUser.username
});
} catch (error) {
console.log("[ACCOUNT]", error);