generated from alecodes/base-template
feat: add basic readwise example
This commit is contained in:
parent
f58db2ecaa
commit
92c9814e2a
10 changed files with 273 additions and 248 deletions
|
|
@ -13,6 +13,16 @@ type Platform struct {
|
|||
Collections []*Collection // Child nodes
|
||||
}
|
||||
|
||||
func (platform *Platform) GetDefaultCollection() (*Collection, error) {
|
||||
for _, collection := range platform.Collections {
|
||||
if collection.IsDefault() {
|
||||
return collection, nil
|
||||
}
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("Default collection not found")
|
||||
}
|
||||
|
||||
// Is a type alias for FetchResponse containing a slice of Collection pointers.
|
||||
type FetchCollectionResponse = FetchResponse[[]*Collection]
|
||||
|
||||
|
|
|
|||
Reference in a new issue