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

Commit8428e8a

Browse files
committed
wip
1 parentd9bfb87 commit8428e8a

File tree

3 files changed

+8
-25
lines changed

3 files changed

+8
-25
lines changed

‎coderd/database/queries/presets.sql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,4 @@ FROM
116116
WHERE
117117
t.id= @template_id
118118
ANDtvp.template_version_id=t.active_version_id
119-
RETURNING*;
119+
RETURNINGtvp.name,tvp.display_name;

‎coderd/templates.go‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,15 +1185,7 @@ func (api *API) postInvalidateTemplatePrebuilds(rw http.ResponseWriter, r *http.
11851185
slog.F("preset_count",len(invalidatedPresets)),
11861186
)
11871187

1188-
// Build list of preset names
1189-
varpresetNames []string
1190-
for_,preset:=rangeinvalidatedPresets {
1191-
presetNames=append(presetNames,preset.Name)
1192-
}
1193-
11941188
httpapi.Write(ctx,rw,http.StatusOK, codersdk.InvalidatePrebuildsResponse{
1195-
Count:len(invalidatedPresets),
1196-
Invalidated:presetNames,
1197-
Failed: []codersdk.InvalidatedPrebuildError{},
1189+
InvalidatedPresets: []codersdk.InvalidatedPreset{},
11981190
})
11991191
}

‎codersdk/templates.go‎

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -508,22 +508,13 @@ func (c *Client) StarterTemplates(ctx context.Context) ([]TemplateExample, error
508508
returntemplateExamples,json.NewDecoder(res.Body).Decode(&templateExamples)
509509
}
510510

511-
// InvalidatePrebuildsResponse contains the result of invalidating prebuilt workspaces.
512511
typeInvalidatePrebuildsResponsestruct {
513-
// Count is the number of presets that were invalidated.
514-
Countint`json:"count"`
515-
// Invalidated is the list of preset names that were invalidated.
516-
Invalidated []string`json:"invalidated"`
517-
// Failed is the list of presets that failed to invalidate with error messages.
518-
Failed []InvalidatedPrebuildError`json:"failed,omitempty"`
519-
}
520-
521-
// InvalidatedPrebuildError represents a failed preset invalidation.
522-
typeInvalidatedPrebuildErrorstruct {
523-
// WorkspaceName is the name of the preset that failed to invalidate.
524-
WorkspaceNamestring`json:"workspace_name"`
525-
// Error is the error message.
526-
Errorstring`json:"error"`
512+
InvalidatedPresets []InvalidatedPreset`json:"invalidated_presets"`
513+
}
514+
515+
typeInvalidatedPresetstruct {
516+
Namestring`json:"preset_name"`
517+
DisplayNamestring`json:"display_name,omitempty"`
527518
}
528519

529520
// InvalidateTemplatePrebuilds invalidates all prebuilt workspaces for the

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp