Skip to content

Commit 48fe155

Browse files
committed
Allow multiple required query params
1 parent dc7a246 commit 48fe155

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)