diff --git a/BanYaroGo/API/DTOs.swift b/BanYaroGo/API/DTOs.swift index 753b477..8f2c6a8 100644 --- a/BanYaroGo/API/DTOs.swift +++ b/BanYaroGo/API/DTOs.swift @@ -204,9 +204,12 @@ struct DiaryEntry: Decodable, Identifiable { let gpsLat: Double? let gpsLon: Double? let locationName: String? - let isMilestone: Bool? - let media: [DiaryMedia]? + // is_milestone kommt als SQLite-Int 0/1 — Backend bool-konvertiert es nicht. + let isMilestone: Int? + let mediaItems: [DiaryMedia]? let createdAt: String? + + var isMilestoneFlag: Bool { isMilestone == 1 } } struct DiaryMedia: Decodable, Identifiable { diff --git a/BanYaroGo/Views/TagebuchView.swift b/BanYaroGo/Views/TagebuchView.swift index e935c95..5cc517c 100644 --- a/BanYaroGo/Views/TagebuchView.swift +++ b/BanYaroGo/Views/TagebuchView.swift @@ -77,7 +77,7 @@ private struct DiaryRow: View { var body: some View { VStack(alignment: .leading, spacing: 8) { HStack(alignment: .firstTextBaseline) { - if entry.isMilestone == true || entry.typ == "meilenstein" { + if entry.isMilestoneFlag || entry.typ == "meilenstein" { Image(systemName: "star.fill").foregroundStyle(.orange) } if let titel = entry.titel, !titel.isEmpty { @@ -103,7 +103,7 @@ private struct DiaryRow: View { .font(.caption) .foregroundStyle(.tertiary) } - if let media = entry.media, !media.isEmpty { + if let media = entry.mediaItems, !media.isEmpty { ScrollView(.horizontal, showsIndicators: false) { HStack(spacing: 6) { ForEach(media) { m in