Allow reporting a problem from the onboarding screen

This commit is contained in:
Stefan Ceriu
2024-01-20 17:10:12 +02:00
parent 261258dd0a
commit 0fe52fe54b
16 changed files with 71 additions and 23 deletions
@@ -119,11 +119,14 @@ class BugReportService: NSObject, BugReportServiceProtocol {
func submitBugReport(_ bugReport: BugReport,
progressListener: CurrentValueSubject<Double, Never>) async -> Result<SubmitBugReportResponse, BugReportServiceError> {
var params = [
MultipartFormData(key: "user_id", type: .text(value: bugReport.userID)),
MultipartFormData(key: "text", type: .text(value: bugReport.text)),
MultipartFormData(key: "can_contact", type: .text(value: "\(bugReport.canContact)"))
]
if let userID = bugReport.userID {
params.append(.init(key: "user_id", type: .text(value: userID)))
}
if let deviceID = bugReport.deviceID {
params.append(.init(key: "device_id", type: .text(value: deviceID)))
}
@@ -19,7 +19,7 @@ import Foundation
import UIKit
struct BugReport: Equatable {
let userID: String
let userID: String?
let deviceID: String?
let text: String
let includeLogs: Bool