dchester / epilogue

Create flexible REST endpoints and controllers from Sequelize models in your Express app
846 stars 116 forks source link

AResouce.list.data.after is not called if AResouce.list.data is not presented #217

Open linktohack opened 6 years ago

linktohack commented 6 years ago

Here is an example:

AResource.list.data.after((req, res, context) => {
    console.log('before instance is');
    return context.continue;
});

// AResource.list.data((req, res, context) => {
//  console.log('instance is', JSON.stringify(context.instance));
//  context.instance = _.map(context.instance, (it: Sequelize.Instance<any>) => db.withoutPassword(it.toJSON()));
//  return context.continue;
// });

If the /data/ block is commented out, the /after/ block is also not executed and vice versa.

I'm using "epilogue": "^0.7.1"