Poder dejar comentarios en borrador
This commit is contained in:
parent
414dd7c920
commit
b996fe1a91
@ -64,7 +64,7 @@ const locationComposer = (location, context) => {
|
||||
|
||||
const commentComposer = (comment, context) => {
|
||||
if (comment.user) {
|
||||
comment.user_name = comment.user.name + '---';
|
||||
comment.user_name = comment.user.name + ' ' + comment.user.surname;
|
||||
comment.profile_picture = cdnHelper.getCDNMediaUrl(comment.user.profile_picture);
|
||||
}else {
|
||||
comment.user_name = comment.nameUserOld;
|
||||
@ -213,6 +213,11 @@ const eventComposer = (event, context) => {
|
||||
multimedias = multimediaComposer(event.multimedias)
|
||||
};
|
||||
|
||||
let comments = [];
|
||||
if ((context.scopes) && (context.scopes.includes('includeComments'))) {
|
||||
comments = commentsComposer(event.comments);
|
||||
};
|
||||
|
||||
let speakers = []
|
||||
let details = []
|
||||
if ((context.scopes) && (context.scopes.includes('includeDetails'))) {
|
||||
@ -233,8 +238,6 @@ const eventComposer = (event, context) => {
|
||||
|
||||
let partners = getPartnersData();
|
||||
|
||||
console.log(partners);
|
||||
|
||||
return Object.assign({},
|
||||
event,
|
||||
{ multimedias: multimedias },
|
||||
|
||||
@ -23,6 +23,11 @@ module.exports = function (sequelize, DataTypes) {
|
||||
profile_pictureOld: {
|
||||
type: DataTypes.STRING(255),
|
||||
},
|
||||
state: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
defaultValue: 'draft'
|
||||
},
|
||||
}, {
|
||||
indexes: [{
|
||||
unique: false,
|
||||
@ -33,6 +38,9 @@ module.exports = function (sequelize, DataTypes) {
|
||||
timestamps: true,
|
||||
|
||||
defaultScope: {
|
||||
where: {
|
||||
state: 'publish',
|
||||
},
|
||||
include: [{
|
||||
model: sequelize.models.User,
|
||||
as: 'user',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user