Refactor authentication components and enhance user session handling

- Updated AccountPopover to utilize session data for user information display.
- Modified ApplicationLayout to fetch user details from the database using Prisma.
- Replaced Checkbox components with native input elements in SignUpForm for better accessibility.
- Enhanced seed script to include default islands and create related data in the database.
This commit is contained in:
2024-12-01 07:40:21 +05:00
parent b91f34b6b1
commit 3f8bb4e70a
4 changed files with 45 additions and 12 deletions

View File

@ -3,6 +3,8 @@ import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
const DEFAULT_ISLANDS = ["Dharanboodhoo", "Feeali", "Nilandhoo", "Magoodhoo"];
async function main() {
const users = Array.from({ length: 25 }, () => ({
name: `${faker.person.fullName().split(" ")[1]} House-${crypto
@ -22,9 +24,23 @@ async function main() {
phoneNumberVerified: false,
role: "USER",
}));
await prisma.user.createMany({
data: users,
});
const FAAFU_ATOLL = await prisma.atoll.create({
data: {
name: "F",
},
});
const islands = DEFAULT_ISLANDS.map((name) => ({
name,
atollId: FAAFU_ATOLL.id,
}));
await prisma.island.createMany({
data: islands,
});
}
main()