a
This commit is contained in:
parent
f50941f45c
commit
b28ead5937
@ -213,7 +213,7 @@ module.exports = function (sequelize, DataTypes) {
|
||||
Event.addScope('includeInscription', (userId) => {
|
||||
return {
|
||||
include: [
|
||||
{ model: sequelize.models.EventInscription, as: 'inscriptions', where: {userId: userId} }
|
||||
{ model: sequelize.models.EventInscription, as: 'inscriptions', required: false, where: {userId: userId} }
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
@ -74,7 +74,9 @@ const extraMethods = {
|
||||
|
||||
|
||||
afterFetchOne: (result, params, context) => {
|
||||
return eventComposer(result.toJSON(), context);
|
||||
if (result)
|
||||
result = result.toJSON();
|
||||
return eventComposer(result, context);
|
||||
},
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user