1- import bcrypt from 'bcrypt' ;
2- import postgres from ' postgres' ;
3- import { invoices , customers , revenue , users } from ' ../lib/placeholder-data' ;
1+ import bcrypt from "bcryptjs" ;
2+ import postgres from " postgres" ;
3+ import { invoices , customers , revenue , users } from " ../lib/placeholder-data" ;
44
5- const sql = postgres ( process . env . POSTGRES_URL ! , { ssl : ' require' } ) ;
5+ const sql = postgres ( process . env . POSTGRES_URL ! , { ssl : " require" } ) ;
66
77async function seedUsers ( ) {
88 await sql `CREATE EXTENSION IF NOT EXISTS "uuid-ossp"` ;
@@ -23,7 +23,7 @@ async function seedUsers() {
2323 VALUES (${ user . id } , ${ user . name } , ${ user . email } , ${ hashedPassword } )
2424 ON CONFLICT (id) DO NOTHING;
2525 ` ;
26- } ) ,
26+ } )
2727 ) ;
2828
2929 return insertedUsers ;
@@ -48,8 +48,8 @@ async function seedInvoices() {
4848 INSERT INTO invoices (customer_id, amount, status, date)
4949 VALUES (${ invoice . customer_id } , ${ invoice . amount } , ${ invoice . status } , ${ invoice . date } )
5050 ON CONFLICT (id) DO NOTHING;
51- ` ,
52- ) ,
51+ `
52+ )
5353 ) ;
5454
5555 return insertedInvoices ;
@@ -73,8 +73,8 @@ async function seedCustomers() {
7373 INSERT INTO customers (id, name, email, image_url)
7474 VALUES (${ customer . id } , ${ customer . name } , ${ customer . email } , ${ customer . image_url } )
7575 ON CONFLICT (id) DO NOTHING;
76- ` ,
77- ) ,
76+ `
77+ )
7878 ) ;
7979
8080 return insertedCustomers ;
@@ -94,8 +94,8 @@ async function seedRevenue() {
9494 INSERT INTO revenue (month, revenue)
9595 VALUES (${ rev . month } , ${ rev . revenue } )
9696 ON CONFLICT (month) DO NOTHING;
97- ` ,
98- ) ,
97+ `
98+ )
9999 ) ;
100100
101101 return insertedRevenue ;
@@ -110,7 +110,7 @@ export async function GET() {
110110 seedRevenue ( ) ,
111111 ] ) ;
112112
113- return Response . json ( { message : ' Database seeded successfully' } ) ;
113+ return Response . json ( { message : " Database seeded successfully" } ) ;
114114 } catch ( error ) {
115115 return Response . json ( { error } , { status : 500 } ) ;
116116 }
0 commit comments