This commit is contained in:
Daniel Arantes Loverde
2026-03-05 10:10:27 -03:00
parent a8e3631177
commit 1407f0b9de
27 changed files with 1493 additions and 84 deletions

View File

@@ -84,12 +84,8 @@ final class ApiClient {
func send<T: Decodable>(_ request: ApiRequest) async throws -> T {
// NOTE:
// /api/customer/login is strict about body fields (email/phoneNumber/otp).
// On iOS, routing this endpoint through URLSession ensures JSON body arrives as-is.
// Also route order-related polling/listing through URLSession to avoid
// intermittent cancellation observed with the shared API bridge.
if request.path == "/api/customer/login" ||
request.path == "/api/app/orders" ||
request.path.hasPrefix("/api/public/orders/") {
// On iOS, route this endpoint through URLSession to preserve raw JSON body behavior.
if request.path == "/api/customer/login" {
if let body = request.body, let bodyText = String(data: body, encoding: .utf8) {
print("[ApiClient] /api/customer/login body: \(bodyText)")
}