Comments (5)
We don't currently support explicitly including/excluding certain attributes during resource definition, but it's not a bad idea. If you don't want to do any work on the module itself the way to go today is to remove the attributes you don't want to expose with a milestone.
If, on the other hand, you're interested in helping build out the feature: we already work with options.attributes
here in order to remove duplicate returned data when using includes. You could perhaps provide a top level attributes
and/or excludeAttributes
option to epilogue.resource
which could further fine-tune that parameter before sending it to model.find
below. This would be a pretty quick fix if you were so inclined
from epilogue.
Ok. I am quite new to node, express and sequelize etc, but I gave it a shot:
It now works as I wished and currently it only supports attributes
but not excludeAttributes
.
I also did no write any test but the existing tests ran without errors.
If you have any suggestions for improvements, feel free to let me know. Thanks!
from epilogue.
@philotas thanks for the work! I'll pull it in presently and write a test or two for it. Are you sure that excludeAttributes
wouldn't suite your purposes better? That way you wouldn't have to manually write out each attribute, just the ones you don't want
from epilogue.
@philotas merged in e30fbfd, you were attributed in the previous commit. I went with excludeAttributes
as that seems to be the primary use case, however resource.attributes
still exists and can be modified directly
from epilogue.
thanks!
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.