Skip to content

Commit

Permalink
Merge branch 'master' into unleash-next
Browse files Browse the repository at this point in the history
  • Loading branch information
linemos authored Oct 13, 2023
2 parents d2d179b + ff27060 commit 78d6a84
Showing 1 changed file with 0 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import org.springframework.http.HttpHeaders.AUTHORIZATION
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestHeader
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
Expand Down Expand Up @@ -69,36 +68,6 @@ class UtbetalingerController(
}
}

@GetMapping("/{fiksDigisosId}/utbetalinger")
fun hentUtbetalingerForSak(@PathVariable fiksDigisosId: String, @RequestHeader(value = AUTHORIZATION) token: String): ResponseEntity<List<UtbetalingerResponse>> {
tilgangskontroll.sjekkTilgang(token)

try {
return ResponseEntity.ok().body(utbetalingerService.hentUtbetalingerForSak(fiksDigisosId, token))
} catch (e: FiksClientException) {
if (e.status == HttpStatus.FORBIDDEN.value()) {
log.error("FiksClientException i UtbetalingerController status: ${e.status} message: ${e.message}", e)
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build()
}
throw e
}
}

@GetMapping("/utbetalinger/exists")
fun getUtbetalingExists(@RequestHeader(value = AUTHORIZATION) token: String, @RequestParam(defaultValue = "15") month: Int): ResponseEntity<Boolean> {
tilgangskontroll.sjekkTilgang(token)

try {
return ResponseEntity.ok().body(utbetalingerService.utbetalingExists(token, month))
} catch (e: FiksClientException) {
if (e.status == HttpStatus.FORBIDDEN.value()) {
log.error("FiksClientException i UtbetalingerController status: ${e.status} message: ${e.message}", e)
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build()
}
throw e
}
}

companion object {
private val log by logger()
}
Expand Down

0 comments on commit 78d6a84

Please sign in to comment.