chore: implement filters for the organizations query (#14468)

Required for organization sync. Allows fetching a filtered set of orgs.
This commit is contained in:
Steven Masley
2024-08-28 13:24:28 -05:00
committed by GitHub
parent 7667d64686
commit 54fe082551
13 changed files with 67 additions and 26 deletions

View File

@ -3,6 +3,7 @@ package coderd
import (
"net/http"
"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/coderd/database/db2sdk"
"github.com/coder/coder/v2/coderd/httpapi"
"github.com/coder/coder/v2/coderd/httpmw"
@ -18,7 +19,7 @@ import (
// @Router /organizations [get]
func (api *API) organizations(rw http.ResponseWriter, r *http.Request) {
ctx := r.Context()
organizations, err := api.Database.GetOrganizations(ctx)
organizations, err := api.Database.GetOrganizations(ctx, database.GetOrganizationsParams{})
if httpapi.Is404Error(err) {
httpapi.ResourceNotFound(rw)
return