Finish some todos

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
Vartan Benohanian
2020-08-17 22:01:04 -04:00
parent ac2fe30647
commit 29fdb0fa19
10 changed files with 103 additions and 81 deletions
+19 -5
View File
@@ -223,15 +223,29 @@ func (s *CollectionService) UpdateDescription(ctx context.Context, id string, de
return s.client.Do(ctx, req, nil)
}
// UpdateLayout updates a collection's layout.
// layout is one of: TIMELINE, GALLERY.
func (s *CollectionService) UpdateLayout(ctx context.Context, id string, layout string) (*Response, error) {
// todo: should we validate layout?
// UpdateLayoutTimeline updates a collection's layout to the timeline format.
func (s *CollectionService) UpdateLayoutTimeline(ctx context.Context, id string) (*Response, error) {
path := "api/v1/collections/update_collection_display_layout"
form := url.Values{}
form.Set("collection_id", id)
form.Set("display_layout", layout)
form.Set("display_layout", "TIMELINE")
req, err := s.client.NewRequestWithForm(http.MethodPost, path, form)
if err != nil {
return nil, err
}
return s.client.Do(ctx, req, nil)
}
// UpdateLayoutGallery updates a collection's layout to the gallery format.
func (s *CollectionService) UpdateLayoutGallery(ctx context.Context, id string) (*Response, error) {
path := "api/v1/collections/update_collection_display_layout"
form := url.Values{}
form.Set("collection_id", id)
form.Set("display_layout", "GALLERY")
req, err := s.client.NewRequestWithForm(http.MethodPost, path, form)
if err != nil {