@@ -33,30 +33,36 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
3333 } ,
3434 } ) ;
3535 if ( campaign ) {
36- await fundingsBase . create ( {
37- id,
38- name,
39- email,
40- phone,
41- campaign,
42- donated_amount : amount ,
43- payment_method : paymentMethod ,
44- status : PaymentStatus . created ,
45- order_id : data . id ,
46- created_at : Date . now ( ) ,
47- } ) ;
36+ await fundingsBase . create (
37+ {
38+ id,
39+ name,
40+ email,
41+ phone,
42+ campaign,
43+ donated_amount : Number ( amount ) ,
44+ payment_method : paymentMethod ,
45+ status : PaymentStatus . created ,
46+ order_id : data . id ,
47+ created_at : Date . now ( ) ,
48+ } ,
49+ { typecast : true }
50+ ) ;
4851 } else {
49- await donationsBase . create ( {
50- id,
51- name,
52- email,
53- phone,
54- donated_amount : amount ,
55- payment_method : paymentMethod ,
56- status : PaymentStatus . created ,
57- order_id : data . id ,
58- created_at : Date . now ( ) ,
59- } ) ;
52+ await donationsBase . create (
53+ {
54+ id,
55+ name,
56+ email,
57+ phone,
58+ donated_amount : Number ( amount ) ,
59+ payment_method : paymentMethod ,
60+ status : PaymentStatus . created ,
61+ order_id : data . id ,
62+ created_at : Date . now ( ) ,
63+ } ,
64+ { typecast : true }
65+ ) ;
6066 }
6167 res . send ( data ) ;
6268 } catch ( error ) {
0 commit comments