Mark functions that need pagination support

This commit is contained in:
Ian Gulliver
2021-09-23 04:33:55 +00:00
parent e85fbd5df9
commit 1a86bcce4d
4 changed files with 5 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ type projectsResponse struct {
}
func (wc *WorkspaceClient) GetProjects() ([]*Project, error) {
// TODO: Handle pagination
path := fmt.Sprintf("workspaces/%s/projects", wc.workspace.GID)
resp := &projectsResponse{}
err := wc.client.get(path, nil, resp)

View File

@@ -20,6 +20,7 @@ type sectionAddTaskRequest struct {
}
func (wc *WorkspaceClient) GetSections(project *Project) ([]*Section, error) {
// TODO: Handle pagination
path := fmt.Sprintf("projects/%s/sections", project.GID)
resp := &sectionsResponse{}
err := wc.client.get(path, nil, resp)
@@ -76,6 +77,7 @@ func (wc *WorkspaceClient) AddTaskToSection(task *Task, section *Section) error
}
func (wc *WorkspaceClient) GetTasksFromSection(section *Section) ([]*Task, error) {
// TODO: Handle pagination
path := fmt.Sprintf("sections/%s/tasks", section.GID)
resp := &tasksResponse{}
err := wc.client.get(path, nil, resp)

View File

@@ -12,6 +12,7 @@ type tagsResponse struct {
}
func (wc *WorkspaceClient) GetTags() ([]*Tag, error) {
// TODO: Handle pagination
path := fmt.Sprintf("workspaces/%s/tags", wc.workspace.GID)
resp := &tagsResponse{}
err := wc.client.get(path, nil, resp)

View File

@@ -24,6 +24,7 @@ func (c *Client) InWorkspace(name string) (*WorkspaceClient, error) {
}
func (c *Client) GetWorkspaces() ([]*Workspace, error) {
// TODO: Handle pagination
resp := &workspacesResponse{}
err := c.get("workspaces", nil, resp)
if err != nil {