Skip to content

Commit

Permalink
feat: update boards find to bring back disable signature property
Browse files Browse the repository at this point in the history
  • Loading branch information
akinsey committed Jun 19, 2020
1 parent 4ae8d11 commit db2f2f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/ept-boards/db/find.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function(id, userPriority) {
else if (!userPriority) { userPriority = Number.MAX_VALUE; }

// get board with given id
var q = 'SELECT b.id, b.name, b.description, b.viewable_by, b.postable_by, b.right_to_left, (b.meta ->> \'disable_post_edit\') as disable_post_edit, b.created_at, b.thread_count, b.post_count, b.updated_at, b.imported_at, (SELECT bm.parent_id FROM board_mapping bm WHERE bm.board_id = b.id) as parent_id, (SELECT json_agg(row_to_json((SELECT x FROM ( SELECT bm.user_id as id, u.username as username) x ))) as moderators from board_moderators bm LEFT JOIN users u ON bm.user_id = u.id WHERE bm.board_id = b.id) as moderators FROM boards b WHERE b.id = $1;';
var q = 'SELECT b.id, b.name, b.description, b.viewable_by, b.postable_by, b.right_to_left, (b.meta ->> \'disable_post_edit\') as disable_post_edit, (b.meta ->> \'disable_signature\') as disable_signature, b.created_at, b.thread_count, b.post_count, b.updated_at, b.imported_at, (SELECT bm.parent_id FROM board_mapping bm WHERE bm.board_id = b.id) as parent_id, (SELECT json_agg(row_to_json((SELECT x FROM ( SELECT bm.user_id as id, u.username as username) x ))) as moderators from board_moderators bm LEFT JOIN users u ON bm.user_id = u.id WHERE bm.board_id = b.id) as moderators FROM boards b WHERE b.id = $1;';
return db.sqlQuery(q, [id])
.then(function(rows) {
if (rows.length > 0) { return rows[0]; }
Expand All @@ -32,6 +32,7 @@ module.exports = function(id, userPriority) {
b.postable_by,
b.right_to_left,
(b.meta ->> 'disable_post_edit') as disable_post_edit,
(b.meta ->> 'disable_signature') as disable_signature,
b.thread_count,
b.post_count,
b.created_at,
Expand Down

0 comments on commit db2f2f9

Please sign in to comment.