add size field to Category data class (#519)

Makes it possible to display the size of a category to the user
This commit is contained in:
schroda
2023-03-25 19:37:50 +01:00
committed by GitHub
parent ec1d65f4c3
commit 5b61bdc3a8
3 changed files with 15 additions and 4 deletions

View File

@@ -12,5 +12,6 @@ data class CategoryDataClass(
val order: Int,
val name: String,
val default: Boolean,
val size: Int,
val meta: Map<String, String> = emptyMap()
)

View File

@@ -23,5 +23,6 @@ fun CategoryTable.toDataClass(categoryEntry: ResultRow) = CategoryDataClass(
categoryEntry[order],
categoryEntry[name],
categoryEntry[isDefault],
Category.getCategorySize(categoryEntry[id].value),
Category.getCategoryMetaMap(categoryEntry[id].value)
)