-
Notifications
You must be signed in to change notification settings - Fork 1
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
EY-4798 Vis advarsel hvis det er gjeldende unntak i saken #6474
Conversation
som brevmalen ikke tar høyde for
import { IAktivitetspliktVurderingNyDto } from '~shared/types/Aktivitetsplikt' | ||
|
||
function loeperUnntakEtterSisteVurdering(vurdering: IAktivitetspliktVurderingNyDto): boolean { | ||
const nyesteVurdering = [...vurdering.aktivitet] |
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.
Trenger vi å lage en ny array her egentlig, kan du ikke bare returnere siste element? :D
import { useAktivitetspliktOppgaveVurdering } from '~components/aktivitetsplikt/OppgaveVurderingRoute' | ||
import { IAktivitetspliktVurderingNyDto } from '~shared/types/Aktivitetsplikt' | ||
|
||
function loeperUnntakEtterSisteVurdering(vurdering: IAktivitetspliktVurderingNyDto): boolean { |
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.
Vi kaller vel "vurdering" her både for aktivitet og unntak, så kanskje loeperUnntakEtterSisteAktivitet
?
const nyesteFom = new Date(nyesteVurdering.fom) | ||
|
||
const harUnntakSomLoeper = vurdering.unntak.some((unntak) => !unntak.tom || new Date(unntak.tom) >= nyesteFom) | ||
return harUnntakSomLoeper |
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.
return in place
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.
Nitpicks
som brevmalen ikke tar høyde for