res will not be used
(r *http.Response, args *api.ApiCollectorArgs)
| 77 | |
| 78 | // res will not be used |
| 79 | func GetTotalPagesFromResponse(r *http.Response, args *api.ApiCollectorArgs) (int, errors.Error) { |
| 80 | data := args.Ctx.GetData().(*TapdTaskData) |
| 81 | apiClient, err := NewTapdApiClient(args.Ctx.TaskContext(), data.Connection) |
| 82 | if err != nil { |
| 83 | return 0, err |
| 84 | } |
| 85 | query := url.Values{} |
| 86 | query.Set("workspace_id", fmt.Sprintf("%v", data.Options.WorkspaceId)) |
| 87 | res, err := apiClient.Get(fmt.Sprintf("%s/count", r.Request.URL.Path), query, nil) |
| 88 | if err != nil { |
| 89 | return 0, err |
| 90 | } |
| 91 | var page Page |
| 92 | err = api.UnmarshalResponse(res, &page) |
| 93 | |
| 94 | count := page.Data.Count |
| 95 | totalPage := count/args.PageSize + 1 |
| 96 | |
| 97 | return totalPage, err |
| 98 | } |
| 99 | |
| 100 | // parseIterationChangelog function is used to parse the iteration changelog |
| 101 | func parseIterationChangelog(taskCtx plugin.SubTaskContext, old string, new string) (iterationFromId int64, iterationToId int64, err errors.Error) { |
nothing calls this directly
no test coverage detected