06/22 Fix Medium impact items
This commit is contained in:
@@ -115,13 +115,22 @@ actor APIClient {
|
||||
func fetchInspectionHistory(
|
||||
limit: Int = 50,
|
||||
offset: Int = 0,
|
||||
facilityId: Int? = nil
|
||||
facilityId: Int? = nil,
|
||||
fromDate: Date? = nil,
|
||||
toDate: Date? = nil
|
||||
) async throws -> InspectionHistoryResponseData {
|
||||
var ep = "/api/v1/inspections?limit=\(limit)&offset=\(offset)&status=completed"
|
||||
if let fid = facilityId { ep += "&facility_id=\(fid)" }
|
||||
if let d = fromDate { ep += "&from_date=\(Self.apiDateFmt.string(from: d))" }
|
||||
if let d = toDate { ep += "&to_date=\(Self.apiDateFmt.string(from: d))" }
|
||||
return try await request(ep)
|
||||
}
|
||||
|
||||
private static let apiDateFmt: DateFormatter = {
|
||||
let f = DateFormatter(); f.dateFormat = "yyyy-MM-dd"; f.locale = Locale(identifier: "en_US_POSIX")
|
||||
return f
|
||||
}()
|
||||
|
||||
// ── Photo Upload ──────────────────────────────────────────────────────
|
||||
|
||||
func uploadPhoto(localPath: String, entityType: String, retrying: Bool = false) async throws -> String {
|
||||
|
||||
Reference in New Issue
Block a user