We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 42e1392 commit f6157c9Copy full SHA for f6157c9
src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/models/hmpps/Response.kt
@@ -1,9 +1,6 @@
1
package uk.gov.justice.digital.hmpps.hmppsintegrationapi.models.hmpps
2
3
-data class Response<T>(
4
- val data: T,
5
- val errors: List<UpstreamApiError> = emptyList(),
6
-) {
+data class Response<T>(val data: T, val errors: List<UpstreamApiError> = emptyList()) {
7
companion object {
8
fun <T> merge(responses: List<Response<List<T>>>): Response<List<T>> = Response(data = responses.flatMap { it.data }, errors = responses.flatMap { it.errors })
9
}
0 commit comments