@@ -3,43 +3,8 @@ import {
33 DeploymentsCollection ,
44 type Project ,
55 ProjectsCollection ,
6- type User ,
7- UsersCollection ,
86} from '/api/schema.ts'
97
10- const users : User [ ] = [
11- {
12- userEmail : 'admin@example.com' ,
13- userFullName : 'Admin User' ,
14- userPicture : undefined ,
15- isAdmin : true ,
16- } ,
17- {
18- userEmail : 'member1@example.com' ,
19- userFullName : 'Member One' ,
20- userPicture : undefined ,
21- isAdmin : false ,
22- } ,
23- {
24- userEmail : 'member2@example.com' ,
25- userFullName : 'Member Two' ,
26- userPicture : undefined ,
27- isAdmin : false ,
28- } ,
29- {
30- userEmail : 'clement@01talent.com' ,
31- userFullName : 'Clement' ,
32- userPicture : undefined ,
33- isAdmin : true ,
34- } ,
35- {
36- userEmail : 'abdou.top@01talent.com' ,
37- userFullName : 'Abdou Top' ,
38- userPicture : undefined ,
39- isAdmin : true ,
40- } ,
41- ]
42-
438const projects : Omit < Project , 'createdAt' > [ ] = [
449 {
4510 slug : 'website-redesign' ,
@@ -66,7 +31,6 @@ const projects: Omit<Project, 'createdAt'>[] = [
6631
6732async function clearCollection (
6833 collection :
69- | typeof UsersCollection
7034 | typeof ProjectsCollection
7135 | typeof DeploymentsCollection ,
7236) {
@@ -81,17 +45,9 @@ async function seed() {
8145 console . log ( 'Starting seeding process...' )
8246
8347 // Clear existing data
84- await clearCollection ( UsersCollection )
8548 await clearCollection ( ProjectsCollection )
8649 await clearCollection ( DeploymentsCollection )
8750
88- // Seed users
89- console . log ( 'Seeding users...' )
90- for ( const user of users ) {
91- await UsersCollection . insert ( user )
92- }
93- console . log ( 'Users seeded.' )
94-
9551 // Seed projects
9652 console . log ( 'Seeding projects...' )
9753 for ( const [ _ , project ] of projects . entries ( ) ) {
0 commit comments