Skip to content

Commit

Permalink
release: 0.8.5 (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
devxb authored Oct 28, 2024
2 parents 46458ef + b7e5177 commit 5b41316
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.gitanimals.render.controller.response

import org.gitanimals.render.domain.FieldType
import org.gitanimals.render.domain.User

data class BackgroundResponse(
Expand All @@ -9,15 +10,17 @@ data class BackgroundResponse(
) {

data class Background(
val type: String,
val type: FieldType,
)

companion object {
fun from(user: User): BackgroundResponse {
return BackgroundResponse(
id = user.id.toString(),
name = user.name,
backgrounds = user.fields.map { Background(it.fieldType.toString()) },
backgrounds = user.fields.map { Background(it.fieldType) }.ifEmpty {
listOf(Background(FieldType.WHITE_FIELD))
},
)
}
}
Expand Down

0 comments on commit 5b41316

Please sign in to comment.