mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-06-30 18:23:49 +00:00
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:
@ -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()
|
||||
|
Reference in New Issue
Block a user