Prechádzať zdrojové kódy

Add 'admin' attribute to thread page so that admin badge will display if user has admin status

sbkwgh 7 rokov pred
rodič
commit
100157883e
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  1. 1 1
      models/thread.js

+ 1 - 1
models/thread.js

@@ -111,7 +111,7 @@ module.exports = (sequelize, DataTypes) => {
 						include: [
 							{ model: models.Thread, attributes: ['slug'] }, 
 							{ model: models.User, as: 'Likes', attributes: ['username', 'createdAt', 'id', 'color', 'picture'] },
-							{ model: models.User, attributes: ['username', 'createdAt', 'id', 'color', 'picture'] }, 
+							{ model: models.User, attributes: ['username', 'createdAt', 'id', 'color', 'picture', 'admin'] }, 
 							{
 								model: models.Post, as: 'Replies', include:
 								[{ model: models.User, attributes: ['username', 'id', 'color', 'picture'] }]