-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
notify convention need signature after been modified #263
The head ref may contain hidden characters: "174-etq-utilisateur-et-acteur-dune-demande-de-convention-je-re\u00E7ois-un-mail-sp\u00E9cifique-pour-minformer-que-la-demande-de-convention-a-\u00E9t\u00E9-modifi\u00E9e-par-un-autre-acteur-et-que-je-dois-la-signer-de-nouveau"
Conversation
76918ff
to
40283ad
Compare
2a74b48
to
283f993
Compare
if (req.payloads?.backOffice || req.payloads?.convention) { | ||
return deps.useCases.updateConvention.execute(req.body); | ||
} | ||
|
||
if (!req.payloads?.convention) throw new UnauthorizedError(); | ||
return deps.useCases.updateConvention.execute({ | ||
id: req.payloads.convention.applicationId, | ||
convention: req.body, | ||
}); | ||
throw new UnauthorizedError(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ici c'est un cas où je trouve le if en guard bien plus clair , comme ceci :
// check de droits
if (!req.payloads?.backOffice && !req.payloads?.convention)
throw new UnauthorizedError();
// usecase si tu as le droit
return deps.useCases.updateConvention.execute(req.body);
const statusJustification = | ||
params.status === "CANCELLED" || | ||
params.status === "REJECTED" || | ||
params.status === "DRAFT" || | ||
params.status === "DEPRECATED" | ||
? params.statusJustification | ||
: undefined; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tu as des utilitaires qui peuvent t'aider dans convention.dto.ts
Genre doesStatusNeedsJustification
, ou tout simplement :
const statusJustification = | |
params.status === "CANCELLED" || | |
params.status === "REJECTED" || | |
params.status === "DRAFT" || | |
params.status === "DEPRECATED" | |
? params.statusJustification | |
: undefined; | |
const statusJustification = conventionStatusesWithJustification.includes(params.status) | |
? params.statusJustification | |
: undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
essaye doesStatusNeedsJustification
je crois bien qu'il y a un type guard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
updateStatus$( | ||
newConvention$(conventionDto: ConventionDto): Observable<void>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on peut garder le verbe stp: createNewConvention$
ou addNewConvention$
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createConvention$
bc94195
to
ae3ade8
Compare
ae3ade8
to
b1f103a
Compare
No description provided.