Change i18n package to paraglideJs
also refactor auth provider
This commit is contained in:
@@ -11,6 +11,7 @@ const prisma = new PrismaClient({ adapter });
|
||||
|
||||
async function main() {
|
||||
console.log('🌱 Seeding database...');
|
||||
let admin;
|
||||
|
||||
// check mail exists
|
||||
const mailExists = await prisma.user.findFirst({
|
||||
@@ -20,7 +21,7 @@ async function main() {
|
||||
});
|
||||
if (!mailExists) {
|
||||
// add admin user
|
||||
await auth.api.createUser({
|
||||
admin = await auth.api.createUser({
|
||||
body: {
|
||||
email: 'luu.dat.tham@gmail.com',
|
||||
password: 'Th@m!S@m!040390',
|
||||
@@ -33,10 +34,21 @@ async function main() {
|
||||
console.log('---------------Created admin user-----------------');
|
||||
await prisma.setting.deleteMany();
|
||||
|
||||
const listSettings = [
|
||||
...settingsData,
|
||||
{
|
||||
key: admin ? (admin?.user?.id as string) : (mailExists?.id as string),
|
||||
value: 'en',
|
||||
description: 'User Settings',
|
||||
relation: 'user',
|
||||
},
|
||||
];
|
||||
|
||||
await prisma.setting.createMany({
|
||||
data: settingsData,
|
||||
data: listSettings,
|
||||
skipDuplicates: true,
|
||||
});
|
||||
console.log('---------------Created settings-----------------');
|
||||
|
||||
// // Clear existing todos
|
||||
// await prisma.todo.deleteMany()
|
||||
|
||||
Reference in New Issue
Block a user