Skip to content

Commit

Permalink
chore: checking if oppgave is ferdigstilt on get
Browse files Browse the repository at this point in the history
Co-authored-by: Andreas <danduras@gmail.com>
  • Loading branch information
jaflaten and andreasDev committed Dec 6, 2024
1 parent d0d8452 commit 97aec96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import no.nav.sykdig.digitalisering.papirsykmelding.db.NasjonalOppgaveRepository
import no.nav.sykdig.digitalisering.papirsykmelding.db.model.NasjonalManuellOppgaveDAO
import no.nav.sykdig.digitalisering.papirsykmelding.db.model.Utfall
import no.nav.sykdig.digitalisering.pdl.PersonService
import no.nav.sykdig.digitalisering.tilgangskontroll.OppgaveSecurityService
import no.nav.sykdig.generated.types.Avvisingsgrunn
import no.nav.sykdig.securelog
import org.springframework.http.HttpStatus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ class NasjonalOppgaveController(
@RequestHeader("Authorization") authorization: String,
): ResponseEntity<PapirManuellOppgave> {
val papirManuellOppgave = nasjonalOppgaveService.getOppgave(oppgaveId, authorization)

if (papirManuellOppgave != null) {
if(papirManuellOppgave.ferdigstilt) {
log.info("Oppgave med id $oppgaveId er allerede ferdigstilt")
return ResponseEntity.noContent().build()
}
return ResponseEntity.ok(nasjonalOppgaveService.mapFromDao(papirManuellOppgave))
}

Expand Down

0 comments on commit 97aec96

Please sign in to comment.