Sending avtocod data to backend

This commit is contained in:
Selim Mustafaev 2025-08-16 12:36:00 +03:00
parent e6f29e9a4e
commit 11070a4b2f
2 changed files with 7 additions and 1 deletions

View File

@ -276,6 +276,10 @@ public actor ApiService: ApiServiceProtocol {
body["events"] = AnyEncodable(events) body["events"] = AnyEncodable(events)
} }
if let avtocodReport {
body["avtocodReport"] = AnyEncodable(avtocodReport)
}
return try await makeBodyRequest(api: "vehicles/check", body: body) return try await makeBodyRequest(api: "vehicles/check", body: body)
} }
@ -364,7 +368,7 @@ public actor ApiService: ApiServiceProtocol {
} }
urlComponents.queryItems = [ urlComponents.queryItems = [
URLQueryItem(name: "number", value: number.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)), URLQueryItem(name: "number", value: number),
URLQueryItem(name: "type", value: numberType.value), URLQueryItem(name: "type", value: numberType.value),
URLQueryItem(name: "device_token", value: UUID().uuidString) URLQueryItem(name: "device_token", value: UUID().uuidString)
] ]

View File

@ -11,4 +11,6 @@ import Foundation
struct AvtocodResponse: Decodable { struct AvtocodResponse: Decodable {
let report_uri: String? let report_uri: String?
let token: String?
let available_reports: Int?
} }