Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Styling pass at filter/kira pilot#2009

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
add backend
  • Loading branch information
@f0ssel
f0ssel committedJun 2, 2022
commite47b6010e4f7393cdeac22e19a5538ea794aa1a2
19 changes: 6 additions & 13 deletionscoderd/workspaces.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -142,13 +142,9 @@ func (api *API) workspaces(rw http.ResponseWriter, r *http.Request) {
filter := database.GetWorkspacesWithFilterParams{Deleted: false}
if orgFilter != "" {
orgID, err := uuid.Parse(orgFilter)
if err != nil {
httpapi.Write(rw, http.StatusBadRequest, httpapi.Response{
Message: fmt.Sprintf("organization_id must be a uuid: %s", err.Error()),
})
return
if err == nil {
filter.OrganizationID = orgID
}
filter.OrganizationID = orgID
}
if ownerFilter == "me" {
filter.OwnerID = apiKey.UserID
Expand All@@ -161,15 +157,12 @@ func (api *API) workspaces(rw http.ResponseWriter, r *http.Request) {
Username: ownerFilter,
Email: ownerFilter,
})
if err != nil {
httpapi.Write(rw, http.StatusBadRequest, httpapi.Response{
Message: "owner must be a uuid or username",
})
return
if err == nil {
filter.OwnerID = user.ID
}
userID = user.ID
} else {
filter.OwnerID = userID
}
filter.OwnerID = userID
}
if nameFilter != "" {
filter.Name = nameFilter
Expand Down
11 changes: 3 additions & 8 deletionscodersdk/workspaces.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"
"net/http"
"strconv"
"time"

"github.com/google/uuid"
Expand DownExpand Up@@ -199,11 +198,10 @@ func (c *Client) PutExtendWorkspace(ctx context.Context, id uuid.UUID, req PutEx
}

type WorkspaceFilter struct {
OrganizationID uuid.UUID
OrganizationID uuid.UUID `json:"organization_id,omitempty"`
// Owner can be a user_id (uuid), "me", or a username
Owner string
Name string
Deleted bool
Owner string `json:"owner,omitempty"`
Name string `json:"name,omitempty"`
}

// asRequestOption returns a function that can be used in (*Client).Request.
Expand All@@ -220,9 +218,6 @@ func (f WorkspaceFilter) asRequestOption() requestOption {
if f.Name != "" {
q.Set("name", f.Name)
}
if f.Deleted {
q.Set("deleted", strconv.FormatBool(f.Deleted))
}
r.URL.RawQuery = q.Encode()
}
}
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp