Refactor reportUrl to reportURL.

This commit is contained in:
Doug
2025-06-18 12:38:21 +01:00
committed by Doug
parent d2562b1b7e
commit 2d926f446a
5 changed files with 11 additions and 7 deletions
@@ -89,7 +89,7 @@ class BugReportScreenViewModel: BugReportScreenViewModelType, BugReportScreenVie
switch await bugReportService.submitBugReport(bugReport,
progressListener: progressSubject) {
case .success(let response):
MXLog.info("Submission uploaded to: \(response.reportUrl)")
MXLog.info("Submission uploaded: \(response.reportURL ?? "The server didn't generate a report URL")")
actionsSubject.send(.submitFinished)
case .failure(let error):
MXLog.error("Submission failed: \(error)")
@@ -137,7 +137,6 @@ class BugReportService: NSObject, BugReportServiceProtocol {
// Parse the JSON data
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase
let uploadResponse = try decoder.decode(SubmitBugReportResponse.self, from: data)
lastCrashEventID = nil
@@ -22,7 +22,11 @@ struct BugReport: Equatable {
}
struct SubmitBugReportResponse: Decodable {
var reportUrl: String?
var reportURL: String?
enum CodingKeys: String, CodingKey {
case reportURL = "report_url"
}
}
enum BugReportServiceError: LocalizedError {