diff --git a/AIStudyApp/AIStudyApp/Features/Library/LibraryViewModel.swift b/AIStudyApp/AIStudyApp/Features/Library/LibraryViewModel.swift index c107a35..2c26b0c 100644 --- a/AIStudyApp/AIStudyApp/Features/Library/LibraryViewModel.swift +++ b/AIStudyApp/AIStudyApp/Features/Library/LibraryViewModel.swift @@ -64,14 +64,11 @@ class LibraryViewModel: ObservableObject { func togglePin(id: String) async { do { - let _ = try await api.post("/knowledge-bases/\(id)/pin") - // reload after pin toggle + let _: GenericSuccessResponse? = try? await APIClient.shared.request("/knowledge-bases/\(id)/pin", method: "POST") await loadKnowledgeBases() } catch {} } - private var api: APIClient { APIClient.shared } - private func fetchKBs(page: Int) async throws -> [KnowledgeBase] { switch currentFilter { case .all: return try await KnowledgeBaseService.shared.list(page: page, limit: pageSize)