8000 Allow multiple required query params · coder/coder@143fad5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 143fad5

Browse files
committed
Allow multiple required query params
1 parent e456c37 commit 143fad5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

coderd/httpapi/queryparams.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ func (p *QueryParamParser) Boolean(vals url.Values, def bool, queryParam string)
9090
return v
9191
}
9292

93-
func (p *QueryParamParser) Required(queryParam string) *QueryParamParser {
94-
p.RequiredParams[queryParam] = true
93+
func (p *QueryParamParser) Required(queryParam ...string) *QueryParamParser {
94+
for _, q := range queryParam {
95+
p.RequiredParams[q] = true
96+
}
9597
return p
9698
}
9799

0 commit comments

Comments
 (0)
0