diff --git a/Sources/Core/API/CardsAPI.swift b/Sources/Core/API/CardsAPI.swift index 90ecba6..63b04b7 100644 --- a/Sources/Core/API/CardsAPI.swift +++ b/Sources/Core/API/CardsAPI.swift @@ -170,7 +170,7 @@ actor CardsAPI { func fetchMedia(id: String) async throws -> Data { let (data, http) = try await transport.request(path: "/api/v1/media/\(id)") guard (200 ..< 300).contains(http.statusCode) else { - throw AuthError.serverError(status: http.statusCode, message: "media fetch failed") + throw AuthError.serverError(status: http.statusCode, code: nil, message: "media fetch failed") } return data } @@ -178,7 +178,7 @@ actor CardsAPI { /// `DELETE /api/v1/media/:id` — Soft-Forget. (Endpoint heute nicht /// implementiert serverseitig; Stub bleibt für späteren Use.) func deleteMedia(id _: String) async throws { - throw AuthError.serverError(status: 501, message: "media delete not implemented on server") + throw AuthError.serverError(status: 501, code: nil, message: "media delete not implemented on server") } // MARK: - Deck-Mutations @@ -326,7 +326,7 @@ actor CardsAPI { private func ensureOK(_ http: HTTPURLResponse, data: Data) throws { guard (200 ..< 300).contains(http.statusCode) else { let message = (try? JSONDecoder().decode(CardsServerError.self, from: data))?.error - throw AuthError.serverError(status: http.statusCode, message: message) + throw AuthError.serverError(status: http.statusCode, code: nil, message: message) } } }