Giter Club home page Giter Club logo

Comments (5)

zaro avatar zaro commented on July 24, 2024

What is the use case for that?

Isn't it enough getting the user from the request object?

from dataui-nestjs-crud.

gantispam avatar gantispam commented on July 24, 2024

Sorry i think my issue is not very clear, i think there is 2 linkeds subjects :

  • Subject 1. Nestjs-crud ask to Map "auth.property". it's pity to dont use this informations for hydrate auth informations on CrudRequest.
    • Exemple of use case :
    • check some additional sécurité rules of AuthGuard directory on services.
    • add author informations on log on services
    • use this object to add some custom business rules (it's my principal let's motivation, i often add some business instructions on CrudRequest.option according to user'auth informations, as role for exemple)
    • Prevent/simplify nestjs pattern that remove singleton pattern on service

This feature give a usefulll "helper" for développer.

  • Subject 2 (linked with subject 1) : If i dont do a mistake all attributs on CrudRequest object is interpreted by nestjs-crud. That feature can be obvious if we need to pass some custom/business param for exemple (throw exception because this custom param is not know on entity ..). Exemple of use case (stupide case 😁 there is a lot of use case more interresting ) :
    • If i want to get my entity A and add some custom attribut on entity for count the number of relationship B, it's usefulll to add "extra.b.count" on request and do my custom request directly on service.

This feature give more flexibility on request process.

from dataui-nestjs-crud.

zaro avatar zaro commented on July 24, 2024

I see, it makes sense yes.

If you are willing to make a PR I will review and merge it. Else we might introduce when we need it, right now we have no immediate need for this functionality but I can see it ( especially the extra parameters) being very useful.

from dataui-nestjs-crud.

gantispam avatar gantispam commented on July 24, 2024

Hi, the PR is here for your code review #13

thx.

from dataui-nestjs-crud.

gantispam avatar gantispam commented on July 24, 2024

Feature is implemented on v5.2.3

https://github.com/gid-oss/dataui-nestjs-crud/tree/v5.2.3

from dataui-nestjs-crud.

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.