mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
chore: implement filters for the organizations query (#14468)
Required for organization sync. Allows fetching a filtered set of orgs.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user