Comments (6)
ResetUserPasswordService
does not require the old password, unlike UpdateUserService
. It also handles fewer of the user's attributes.
from alertadotesouro.
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.
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.
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.
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.
from alertadotesouro.
Related Issues (20)
- Set up `nodemailer` with Mailtrap as server HOT 1
- Rewrite solution for creating `TreasuryBond` objects such that it does not rely on an endpoint handling POST requests. HOT 1
- Implement 'forgot my password' functionality HOT 1
- Create automated tests HOT 6
- Document existing endpoints
- Integrate CodeCov (CI) HOT 1
- Input icons don't change color correctly if an error occurs HOT 2
- Create ToS and Privacy Statement HOT 5
- Create User data export
- Finish implementing `/conta` front-end page/route
- Create email confirmation result page or redirect to login with result message
- New feature: Resend confirmation email HOT 2
- Implement functionality for `/dashboard` front-end route HOT 2
- Improve navbar
- Completely blow up and redo Toasts HOT 3
- Clean up redundancy in style files
- Briefly disable buttons after they're pressed
- Implement functionality for interacting with notifications on `/notificacoes` front-end route
- Send browser notifications when bond returns criteria is match and user wants them HOT 3
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 alertadotesouro.