π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
API: Fix GetCollection
Neeraj Guptae3c6f4c8a7bc
diff --git a/internal/api/collection.go b/internal/api/collection.goindex 5977249816..2b24145a60 100644--- a/internal/api/collection.go+++ b/internal/api/collection.go@@ -3,11 +3,20 @@ package apiimport "context"func (c *Client) GetCollections(ctx context.Context, sinceTime int) ([]Collection, error) {- var collections []Collection- _, err := c.restClient.R().+ var res struct {+ Collections []Collection `json:"collections"`+ }+ r, err := c.restClient.R().SetContext(ctx).- SetQueryParam("since", string(sinceTime)).- SetResult(&collections).+ SetQueryParam("since", "0").+ SetResult(&res).Get("/collections")- return collections, err+ if r.IsError() {+ return nil, &ApiError{+ StatusCode: r.StatusCode(),+ Message: r.String(),+ }+ }++ return res.Collections, err}