Skip to content

Commit

Permalink
fix syntax err
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzivenu committed Oct 2, 2018
1 parent 9a829ad commit b7f34f9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/db-engines/post-by-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,24 @@ module.exports = async function (op, timestamp) {

try {
var post_app = JSON.parse(op[1].json_metadata).app;

if (post_app.indexOf(config.target) > -1) {

if (!post_app) {

return;

} else if (post_app && post_app.indexOf(config.target) > -1) {

try {
var sql = 'CALL new_post(?,?,?,?,?,?,?)';

var details = [ op[1].author, op[1].permlink, op[1].parent_permlink, op[1].title, op[1].body, ('/@' + op[1].author + '/' + op[1].permlink), timestamp ];

await pool.query(sql, details);

}
catch (err) {
} catch (err) {
console.log(err);
}
}
}
catch (err) {
Expand Down

0 comments on commit b7f34f9

Please sign in to comment.