diff --git a/AIStudyApp/AIStudyApp/Core/Services/APIService.swift b/AIStudyApp/AIStudyApp/Core/Services/APIService.swift index 1c8d0b9..59a53a6 100644 --- a/AIStudyApp/AIStudyApp/Core/Services/APIService.swift +++ b/AIStudyApp/AIStudyApp/Core/Services/APIService.swift @@ -234,12 +234,6 @@ class LearningSessionService { return try await client.request("/learning-sessions/\(id)/end", method: "POST") } - func list(page: Int = 1, limit: Int = 20) async throws -> [LearningSession] { - return try await client.request("/learning-sessions", queryItems: [ - URLQueryItem(name: "page", value: String(page)), - URLQueryItem(name: "limit", value: String(limit)), - ]) - } } // MARK: - Review @@ -278,9 +272,7 @@ class FocusItemService { } func update(id: String, masteryScore: Int? = nil, title: String? = nil) async throws -> FocusItem { - var body: [String: Any] = [:] - if let s = masteryScore { body["masteryScore"] = s } - if let t = title { body["title"] = t } + let body = FocusItemUpdateRequest(masteryScore: masteryScore, title: title) return try await client.request("/focus-items/\(id)", method: "PATCH", body: body) } @@ -483,6 +475,11 @@ struct NotificationPreferences: Codable { var systemNotice: Bool? } +struct FocusItemUpdateRequest: Codable { + let masteryScore: Int? + let title: String? +} + struct FocusItemCompleteRequest: Codable { let id: String }