fix(ios): togglePin 改用 APIClient.request 替代不存在的 .post
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
d1b3ac160a
commit
e254db0ba4
@ -64,14 +64,11 @@ class LibraryViewModel: ObservableObject {
|
|||||||
|
|
||||||
func togglePin(id: String) async {
|
func togglePin(id: String) async {
|
||||||
do {
|
do {
|
||||||
let _ = try await api.post("/knowledge-bases/\(id)/pin")
|
let _: GenericSuccessResponse? = try? await APIClient.shared.request("/knowledge-bases/\(id)/pin", method: "POST")
|
||||||
// reload after pin toggle
|
|
||||||
await loadKnowledgeBases()
|
await loadKnowledgeBases()
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var api: APIClient { APIClient.shared }
|
|
||||||
|
|
||||||
private func fetchKBs(page: Int) async throws -> [KnowledgeBase] {
|
private func fetchKBs(page: Int) async throws -> [KnowledgeBase] {
|
||||||
switch currentFilter {
|
switch currentFilter {
|
||||||
case .all: return try await KnowledgeBaseService.shared.list(page: page, limit: pageSize)
|
case .all: return try await KnowledgeBaseService.shared.list(page: page, limit: pageSize)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user