use useSWR data instead calling setState

This commit is contained in:
notmd
2023-01-16 10:09:54 +07:00
parent da6a3b687e
commit 8028693e3b
5 changed files with 39 additions and 59 deletions
@@ -44,6 +44,7 @@ if (boolean(process.env.DEBUG_LOGIN) || process.env.NODE_ENV === "development")
const user = {
id: credentials.username,
name: credentials.username,
role: "admin",
};
// save the user to the database
await prisma.user.upsert({