add lists to user home

This commit is contained in:
2018-09-10 22:55:31 +02:00
parent f6bb683cc9
commit 17756b4d13
7 changed files with 53 additions and 17 deletions

View File

@@ -79,3 +79,21 @@ func (p *PixelAPI) UserFiles(page, limit int) (resp *UserFiles, err error) {
}
return resp, nil
}
type UserLists struct {
Success bool `json:"success"`
Lists []List `json:"lists"`
}
func (p *PixelAPI) UserLists(page, limit int) (resp *UserLists, err error) {
resp = &UserLists{Lists: make([]List, 0)}
err = p.jsonRequest(
"GET",
fmt.Sprintf("%s/user/lists?page=%d&limit=%d", p.apiEndpoint, page, limit),
resp,
)
if err != nil {
return nil, err
}
return resp, nil
}