Git Product home page Git Product logo

Comments (6)

AtilioA avatar AtilioA commented on June 22, 2024

ResetUserPasswordService does not require the old password, unlike UpdateUserService. It also handles fewer of the user's attributes.

from alertadotesouro.

Henriquelay avatar Henriquelay commented on June 22, 2024

Do you think it's sensible to treat in a single one for both operations, since both are UPDATING a field?

We check if newPassword is found and if it is, we treat as a password change aswell. Otherwise, regular attributes updating.
Can we bring field checking to the controller? Is it a good practice?

from alertadotesouro.

AtilioA avatar AtilioA commented on June 22, 2024

Can we bring field checking to the controller? Is it a good practice?

I think it's up to the service to handle that.

In any case, we shouldn't be worrying about this :(

from alertadotesouro.

Henriquelay avatar Henriquelay commented on June 22, 2024

Whatsapp
Can we transform this into a MVC best practices discussion then?
I do believe it's more about
Controller - Connection, input validation, technical means to accomplish thing
Service - do the thing, devoid of other types of validation, pure business logic.

from alertadotesouro.

AtilioA avatar AtilioA commented on June 22, 2024

We aren't using an MVC architecture but sure
This discussion is similar to ours and the answers are especially relevant: https://stackoverflow.com/questions/46479889/validation-in-controller-or-service

from alertadotesouro.

AtilioA avatar AtilioA commented on June 22, 2024

😈

from alertadotesouro.

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.