MCPcopy Create free account
hub / github.com/driangle/taskmd / buildQueryParams

Function buildQueryParams

apps/cli/internal/sync/github/github.go:175–201  ·  view source on GitHub ↗
(filters map[string]any)

Source from the content-addressed store, hash-verified

173}
174
175func buildQueryParams(filters map[string]any) url.Values {
176 params := url.Values{}
177 params.Set("per_page", strconv.Itoa(perPage))
178
179 hasState := false
180 for key, val := range filters {
181 switch key {
182 case "labels":
183 params.Set("labels", toCommaSeparated(val))
184 case "milestone":
185 params.Set("milestone", fmt.Sprint(val))
186 case "assignee":
187 params.Set("assignee", fmt.Sprint(val))
188 case "state":
189 params.Set("state", fmt.Sprint(val))
190 hasState = true
191 default:
192 params.Set(key, fmt.Sprint(val))
193 }
194 }
195
196 if !hasState {
197 params.Set("state", "all")
198 }
199
200 return params
201}
202
203func toCommaSeparated(val any) string {
204 switch v := val.(type) {

Callers 1

FetchTasksMethod · 0.85

Calls 1

toCommaSeparatedFunction · 0.85

Tested by

no test coverage detected