05/11 Update issue image upload

This commit is contained in:
Nguyen Ngo
2026-05-11 17:31:21 -04:00
parent 6367dac1e6
commit 9fd3f5b829
6 changed files with 223 additions and 67 deletions
+2 -1
View File
@@ -194,7 +194,8 @@ actor APIClient {
"mobile_local_id": issue.localId,
]
if let id = issue.inspection?.serverId { body["inspection_id"] = id }
if let path = issue.photoServerPath { body["photo_path"] = path }
// Send the first uploaded photo as photo_path (server Issue.photo_path is a single column)
if let firstPhoto = issue.photoServerPaths.first { body["photo_path"] = firstPhoto }
struct R: Decodable, Sendable { let issueId: Int; let duplicate: Bool }
let r: R = try await post("/api/v1/issues", body: body)