2017-11-27 14:08:18 +00:00
|
|
|
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 {
|
2018-05-28 10:22:35 +00:00
|
|
|
async getData(params, cb) {
|
2017-11-27 14:08:18 +00:00
|
|
|
let query = `SELECT
|
|
|
|
socialName
|
|
|
|
FROM client c
|
|
|
|
JOIN country ct ON ct.id = c.countryFk
|
|
|
|
WHERE c.id = ?`;
|
2018-05-28 10:22:35 +00:00
|
|
|
try {
|
|
|
|
let [result] = await database.pool.query(query, [params.clientId]);
|
2017-11-27 14:08:18 +00:00
|
|
|
Object.assign(this, result[0]);
|
2018-05-28 10:22:35 +00:00
|
|
|
} catch (e) {
|
|
|
|
return cb(new Error('No template data found'));
|
|
|
|
}
|
|
|
|
cb();
|
2017-11-27 14:08:18 +00:00
|
|
|
}
|
|
|
|
};
|