Same root-cause fix as feature/home-page, applied to this branch's
copy of the pin code (which additionally has the sidebar's real
per-collection Pin wiring):
- pins.list's real response is {data: {pins: [...], documents: [...]}},
not a bare array — confirmed against a live server. Decoding straight
to [OutlinePin] threw every call; try? swallowed it, so pins never
showed up (even a doc pinned for real via the web app).
- "Pin to Home" (web's actual label) sends collectionId: null; "Pin to
Collection" sends a real id — distinct actions. The reader toolbar's
Pin was sending the doc's own collectionId under a plain "Pin" label,
silently doing the wrong one. Fixed to nil, relabeled "Pin to Home".
- Sidebar's per-document Pin was already correctly scoped to
collection.id — relabeled "Pin to Collection" for clarity, no logic
change.
11 lines
270 B
Swift
11 lines
270 B
Swift
import Foundation
|
|
|
|
/// See `OutlinePin`. `collectionId: nil` lists Home pins only.
|
|
public struct ListPinsRequest: Encodable, Sendable {
|
|
public let collectionId: String?
|
|
|
|
public init(collectionId: String? = nil) {
|
|
self.collectionId = collectionId
|
|
}
|
|
}
|