Create models/Transaction.js
Browse files- 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;
|