Comments (2)
@Bixibu this is sort of a weak point in the design unfortunately. Certain controllers behave differently, so your assumptions are not correct for the ListController. Generally, the json encoding actually occurs as part of the default send milestone: https://github.com/dchester/epilogue/blob/master/lib/Controllers/base.js#L67.
The 'data' milestone is not actually defined for any of the controllers by default, but you can assign a 'data' step in order to manipulate (or check) the data. That's probably where I would put my checks. As for why the "before" and "after" aren't called, well that's because there is nothing for there to be before or after! You need to define a data milestone, and then if you want to do something before that you can define a list.data.before
from epilogue.
In case that wasn't so clear above: if you want access to the generated JSON, we don't prepare that explicitly before sending a res.json
in the send step. You can validate the context.instance
at any point in your workflow, or you could actually set context.instance
to the JSON yourself on a list.send.before
step maybe?
from epilogue.
Related Issues (20)
- Support to check if Postgres array contains string?
- create inserts nulls on postgres db? HOT 1
- Workflow for pull requests? HOT 2
- Typescript support? HOT 4
- AResouce.list.data.after is not called if AResouce.list.data is not presented
- Controller List is not applying attributes of Model Scope as specified in req.query.scope HOT 1
- search by parameter 'q' does not work HOT 12
- Order of associations HOT 1
- repo unmaintained! active fork: https://github.com/tommybananas/finale HOT 4
- How to add another options item while creating an model instance?
- app[self.method] is not a function
- [Read Endpoint] Get data from two models HOT 1
- Filtering/sorting by association fields
- Project status HOT 1
- EpilogueError: internal error HOT 1
- Sorting ignored with hasMany relationships
- How to define all API routes to be in a separate group
- How do I add auth to all actions of a Resource? HOT 1
- How can I assign fetching items to POST request?
- Cannot set headers after they are sent to the client HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from epilogue.