mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-19 12:09:15 +00:00
start with adapter
This commit is contained in:
9
adapter/mysql.js
Normal file
9
adapter/mysql.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const {connection} = require('../config/mysql')
|
||||
|
||||
const getData = (option_key = '', callback) => connection.query(`SELECT * FROM db_test.keywords WHERE option_key = '${option_key}' LIMIT 1`,(error, results, fields) => {
|
||||
const [response] = results
|
||||
let parseResponse = response?.value || '';
|
||||
parseResponse = parseResponse.split(',') || []
|
||||
callback(parseResponse)
|
||||
});
|
||||
module.exports = {getData}
|
||||
Reference in New Issue
Block a user