Skip to content

Commit

Permalink
fix: prevent json parsing errors in ReportDoc data class (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwwinter authored Jun 6, 2024
1 parent 00f5ace commit 1ed881f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ data class ReportDoc(
@JsonProperty("_rev")
val rev: String,
val title: String,
val mode: String,
val aggregationDefinition: String,
val mode: String = "unknown",
val aggregationDefinition: String?,
val created: EditAtBy?,
val updated: EditAtBy?,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class DefaultReportingStorage(
id = it.id,
name = it.doc.title,
mode = it.doc.mode,
query = it.doc.aggregationDefinition,
query = it.doc.aggregationDefinition ?: "",
schema = ReportSchema(
fields = reportSchemaGenerator.getTableNamesByQuery(it.doc.aggregationDefinition)
fields = reportSchemaGenerator.getTableNamesByQuery(it.doc.aggregationDefinition ?: "")
)
)
}
Expand All @@ -68,10 +68,10 @@ class DefaultReportingStorage(
Report(
id = reportDoc.id,
name = reportDoc.title,
query = reportDoc.aggregationDefinition,
query = reportDoc.aggregationDefinition ?: "",
mode = reportDoc.mode,
schema = ReportSchema(
fields = reportSchemaGenerator.getTableNamesByQuery(reportDoc.aggregationDefinition)
fields = reportSchemaGenerator.getTableNamesByQuery(reportDoc.aggregationDefinition ?: "")
)
)
)
Expand Down

0 comments on commit 1ed881f

Please sign in to comment.