Переглянути джерело

Include color field on user; add bright luminosity option to color generation

sbkwgh 8 роки тому
батько
коміт
4b559e50e1
1 змінених файлів з 2 додано та 2 видалено
  1. 2 2
      models/category.js

+ 2 - 2
models/category.js

@@ -18,7 +18,7 @@ module.exports = (sequelize, DataTypes) => {
 		color: {
 			type: DataTypes.STRING,
 			defaultValue () {
-				return randomColor()
+				return randomColor({ luminosity: 'bright' })
 			}
 		}
 	}, {
@@ -32,7 +32,7 @@ module.exports = (sequelize, DataTypes) => {
 					model: models.Thread, 
 					include: [
 						models.Category,
-						{ model: models.User, attributes: ['username', 'createdAt', 'id'] }, 
+						{ model: models.User, attributes: ['username', 'createdAt', 'id', 'color'] }, 
 						{
 							model: models.Post, limit: 1, order: [['id', order]], include:
 							[{ model: models.User, attributes: ['username', 'id'] }]