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

Commit4e6ad18

Browse files
committed
refactor: use workspace names instead of UUIDs in response
Change InvalidatePrebuildsResponse.Workspaces from []uuid.UUID to []stringcontaining workspace names for better readability.
1 parentf31af9c commit4e6ad18

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎coderd/templates.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,13 +1208,13 @@ func (api *API) postInvalidateTemplatePrebuilds(rw http.ResponseWriter, r *http.
12081208
iflen(prebuildWorkspaces)==0 {
12091209
httpapi.Write(ctx,rw,http.StatusOK, codersdk.InvalidatePrebuildsResponse{
12101210
Count:0,
1211-
Workspaces: []uuid.UUID{},
1211+
Workspaces: []string{},
12121212
})
12131213
return
12141214
}
12151215

12161216
// Delete each prebuilt workspace using the existing workspace delete logic
1217-
varinvalidatedWorkspaces []uuid.UUID
1217+
varinvalidatedWorkspaces []string
12181218

12191219
api.Logger.Info(ctx,"invalidating prebuilt workspaces",
12201220
slog.F("template_id",template.ID),
@@ -1248,7 +1248,7 @@ func (api *API) postInvalidateTemplatePrebuilds(rw http.ResponseWriter, r *http.
12481248
continue
12491249
}
12501250

1251-
invalidatedWorkspaces=append(invalidatedWorkspaces,workspace.ID)
1251+
invalidatedWorkspaces=append(invalidatedWorkspaces,workspace.Name)
12521252
}
12531253

12541254
api.Logger.Info(ctx,"completed prebuild invalidation",

‎codersdk/templates.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,8 @@ func (c *Client) StarterTemplates(ctx context.Context) ([]TemplateExample, error
512512
typeInvalidatePrebuildsResponsestruct {
513513
// Count is the number of prebuilt workspaces that were invalidated.
514514
Countint`json:"count"`
515-
// Workspaces is the list of invalidated prebuilt workspaceIDs.
516-
Workspaces []uuid.UUID`json:"workspaces"`
515+
// Workspaces is the list of invalidated prebuilt workspacenames.
516+
Workspaces []string`json:"workspaces"`
517517
}
518518

519519
// InvalidateTemplatePrebuilds invalidates all prebuilt workspaces for the

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp