diff --git a/ios/Platform/Platform/Features/Feedback/FeedbackView.swift b/ios/Platform/Platform/Features/Feedback/FeedbackView.swift index da29b01..39057cc 100644 --- a/ios/Platform/Platform/Features/Feedback/FeedbackView.swift +++ b/ios/Platform/Platform/Features/Feedback/FeedbackView.swift @@ -100,15 +100,15 @@ struct FeedbackSheet: View { do { let body: [String: String] = ["text": text.trimmingCharacters(in: .whitespaces), "source": "ios"] let jsonData = try JSONSerialization.data(withJSONObject: body) - let (data, response) = try await APIClient.shared.rawPost("/api/feedback", body: jsonData) + let data = try await APIClient.shared.rawPost(path: "/api/feedback", data: jsonData) - if let httpResp = response as? HTTPURLResponse, httpResp.statusCode < 300 { + let respBody = try? JSONSerialization.jsonObject(with: data) as? [String: Any] + if respBody?["ok"] as? Bool == true { withAnimation { sent = true } DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) { dismiss() } } else { - let respBody = try? JSONSerialization.jsonObject(with: data) as? [String: Any] error = (respBody?["error"] as? String) ?? "Failed to send" } } catch {