21 lines
694 B
JavaScript
21 lines
694 B
JavaScript
var path = require('path');
|
|
var database = require(path.join(__dirname, '../../database.js'));
|
|
var format = require(path.join(__dirname, '../../util/format.js'));
|
|
|
|
module.exports = class Footer {
|
|
async getData(params, cb) {
|
|
let query = `SELECT
|
|
socialName
|
|
FROM client c
|
|
JOIN country ct ON ct.id = c.countryFk
|
|
WHERE c.id = ?`;
|
|
try {
|
|
let [result] = await database.pool.query(query, [params.clientId]);
|
|
Object.assign(this, result[0]);
|
|
} catch (e) {
|
|
return cb(new Error('No template data found'));
|
|
}
|
|
cb();
|
|
}
|
|
};
|