NoLev commited on
Commit
80ddec3
·
verified ·
1 Parent(s): f5fb471

Create models/Transaction.js

Browse files
Files changed (1) hide show
  1. models/Transaction.js +10 -0
models/Transaction.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ const pool = require('../config/db');
2
+
3
+ const Transaction = {
4
+ create: async (user_id, type, amount, status, wallet_address) => {
5
+ await pool.query('INSERT INTO transactions (user_id, type, amount, status, wallet_address) VALUES (?, ?, ?, ?, ?)',
6
+ [user_id, type, amount, status, wallet_address]);
7
+ }
8
+ };
9
+
10
+ module.exports = Transaction;