Coder Social home page Coder Social logo

Comments (5)

mbroadst avatar mbroadst commented on June 25, 2024

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.

philotas avatar philotas commented on June 25, 2024

Ok. I am quite new to node, express and sequelize etc, but I gave it a shot:

philotas@5667765

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.

mbroadst avatar mbroadst commented on June 25, 2024

@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.

mbroadst avatar mbroadst commented on June 25, 2024

@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.

philotas avatar philotas commented on June 25, 2024

thanks!

from epilogue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.