Skip to content

Commit c6e3a57

Browse files
committed
Move WorkspaceSearchQuery to workspaces.go
1 parent c64ed18 commit c6e3a57

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

coderd/workspaces.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (api *API) workspaces(rw http.ResponseWriter, r *http.Request) {
104104
apiKey := httpmw.APIKey(r)
105105

106106
queryStr := r.URL.Query().Get("q")
107-
values, err := httpapi.WorkspaceSearchQuery(queryStr)
107+
values, err := WorkspaceSearchQuery(queryStr)
108108
if err != nil {
109109
httpapi.Write(rw, http.StatusBadRequest, httpapi.Response{
110110
Message: "Invalid workspace search query.",

coderd/httpapi/search.go renamed to coderd/workspacesearch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package httpapi
1+
package coderd
22

33
import (
44
"strings"

coderd/httpapi/search_test.go renamed to coderd/workspacesearch_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
package httpapi_test
1+
package coderd_test
22

33
import (
44
"testing"
55

6+
"github.com/coder/coder/coderd"
67
"github.com/stretchr/testify/require"
7-
8-
"github.com/coder/coder/coderd/httpapi"
98
)
109

1110
func TestSearchWorkspace(t *testing.T) {
@@ -125,7 +124,7 @@ func TestSearchWorkspace(t *testing.T) {
125124
c := c
126125
t.Run(c.Name, func(t *testing.T) {
127126
t.Parallel()
128-
values, err := httpapi.WorkspaceSearchQuery(c.Query)
127+
values, err := coderd.WorkspaceSearchQuery(c.Query)
129128
if c.ExpectedErrorContains != "" {
130129
require.Error(t, err, "expected error")
131130
require.ErrorContains(t, err, c.ExpectedErrorContains)

0 commit comments

Comments
 (0)