diff --git a/app/controllers/ReportBlockedNotificationController.scala b/app/controllers/ReportBlockedNotificationController.scala index e3b33628..e8055525 100644 --- a/app/controllers/ReportBlockedNotificationController.scala +++ b/app/controllers/ReportBlockedNotificationController.scala @@ -24,27 +24,25 @@ class ReportBlockedNotificationController( } def create() = - Act.secured.pros.forbidImpersonation.async(parse.json) { - implicit request => - request.body - .validate[ReportBlockedNotificationBody] - .fold( - errors => Future.successful(BadRequest(JsError.toJson(errors))), - body => - orchestrator - .createIfNotExists(request.identity.id, body.companyIds) - .map(entity => Ok(Json.toJson(entity))) - ) + Act.secured.pros.forbidImpersonation.async(parse.json) { implicit request => + request.body + .validate[ReportBlockedNotificationBody] + .fold( + errors => Future.successful(BadRequest(JsError.toJson(errors))), + body => + orchestrator + .createIfNotExists(request.identity.id, body.companyIds) + .map(entity => Ok(Json.toJson(entity))) + ) } def delete() = - Act.secured.pros.forbidImpersonation.async(parse.json) { - implicit request => - request.body - .validate[ReportBlockedNotificationBody] - .fold( - errors => Future.successful(BadRequest(JsError.toJson(errors))), - body => orchestrator.delete(request.identity.id, body.companyIds).map(_ => Ok) - ) + Act.secured.pros.forbidImpersonation.async(parse.json) { implicit request => + request.body + .validate[ReportBlockedNotificationBody] + .fold( + errors => Future.successful(BadRequest(JsError.toJson(errors))), + body => orchestrator.delete(request.identity.id, body.companyIds).map(_ => Ok) + ) } } diff --git a/app/controllers/ReportFileController.scala b/app/controllers/ReportFileController.scala index bcb0e539..a15eaff4 100644 --- a/app/controllers/ReportFileController.scala +++ b/app/controllers/ReportFileController.scala @@ -68,17 +68,18 @@ class ReportFileController( ) } - def downloadZip(reportId: UUID, origin: Option[ReportFileOrigin]) = Act.secured.all.allowImpersonation.async { request => - for { - reportExtra <- visibleReportOrchestrator.getVisibleReportOrThrow(reportId, request.identity) - report = reportExtra.report - stream <- reportFileOrchestrator.downloadReportFilesArchive(report, origin) - } yield Ok - .chunked(stream) - .as("application/zip") - .withHeaders( - "Content-Disposition" -> s"attachment; filename=${frenchFileFormatDate(report.creationDate)}.zip" - ) + def downloadZip(reportId: UUID, origin: Option[ReportFileOrigin]) = Act.secured.all.allowImpersonation.async { + request => + for { + reportExtra <- visibleReportOrchestrator.getVisibleReportOrThrow(reportId, request.identity) + report = reportExtra.report + stream <- reportFileOrchestrator.downloadReportFilesArchive(report, origin) + } yield Ok + .chunked(stream) + .as("application/zip") + .withHeaders( + "Content-Disposition" -> s"attachment; filename=${frenchFileFormatDate(report.creationDate)}.zip" + ) }