Skip to content

Commit

Permalink
Further review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
annielh committed Nov 19, 2024
1 parent 21752c0 commit d91edb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/DraftMetadataChecksResultsController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@ class DraftMetadataChecksResultsController @Inject() (
reference <- consignmentService.getConsignmentRef(consignmentId, request.token.bearerAccessToken)
errorReport <- draftMetadataService.getErrorReport(consignmentId)
} yield {
val orderingPrioritisingRowErrors: Ordering[Error] =
val errorPriorityOrdering: Ordering[Error] =
Ordering.by[Error, (Boolean, String)](e => (!e.validationProcess.equals(s"$priorityErrorType"), e.validationProcess))
val errorList = errorReport.fileError match {
case SCHEMA_VALIDATION =>
errorReport.validationErrors.flatMap { validationErrors =>
val data = validationErrors.data.map(metadata => metadata.name -> metadata.value).toMap
validationErrors.errors.toList
.sorted(orderingPrioritisingRowErrors)
.sorted(errorPriorityOrdering)
.map(error => List(validationErrors.assetId, error.property, data.getOrElse(error.property, ""), error.message))
}
case _ => Nil
Expand Down

0 comments on commit d91edb3

Please sign in to comment.