From e254db0ba4d8629403f9356576327865aaccef68 Mon Sep 17 00:00:00 2001 From: wangdl Date: Sat, 30 May 2026 09:07:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(ios):=20togglePin=20=E6=94=B9=E7=94=A8=20AP?= =?UTF-8?q?IClient.request=20=E6=9B=BF=E4=BB=A3=E4=B8=8D=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E7=9A=84=20.post?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.7 --- .../AIStudyApp/Features/Library/LibraryViewModel.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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)