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

Commitc309d91

Browse files
committed
apply pr review suggestions
1 parent71843be commitc309d91

File tree

7 files changed

+42
-42
lines changed

7 files changed

+42
-42
lines changed

‎coderd/aitasks.go‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -593,9 +593,9 @@ func (api *API) tasksList(rw http.ResponseWriter, r *http.Request) {
593593
// @Security CoderSessionToken
594594
// @Tags Experimental
595595
// @Param user path string true "Username, user ID, or 'me' for the authenticated user"
596-
// @Paramid path string true "Task ID" format(uuid)
596+
// @Paramtask path string true "Task ID" format(uuid)
597597
// @Success 200 {object} codersdk.Task
598-
// @Router /api/experimental/tasks/{user}/{id} [get]
598+
// @Router /api/experimental/tasks/{user}/{task} [get]
599599
//
600600
// EXPERIMENTAL: This endpoint is experimental and not guaranteed to be stable.
601601
// taskGet is an experimental endpoint to fetch a single AI task by ID
@@ -605,7 +605,7 @@ func (api *API) taskGet(rw http.ResponseWriter, r *http.Request) {
605605
ctx:=r.Context()
606606
apiKey:=httpmw.APIKey(r)
607607

608-
idStr:=chi.URLParam(r,"id")
608+
idStr:=chi.URLParam(r,"task")
609609
taskID,err:=uuid.Parse(idStr)
610610
iferr!=nil {
611611
httpapi.Write(ctx,rw,http.StatusBadRequest, codersdk.Response{
@@ -710,9 +710,9 @@ func (api *API) taskGet(rw http.ResponseWriter, r *http.Request) {
710710
// @Security CoderSessionToken
711711
// @Tags Experimental
712712
// @Param user path string true "Username, user ID, or 'me' for the authenticated user"
713-
// @Paramid path string true "Task ID" format(uuid)
713+
// @Paramtask path string true "Task ID" format(uuid)
714714
// @Success 202 "Task deletion initiated"
715-
// @Router /api/experimental/tasks/{user}/{id} [delete]
715+
// @Router /api/experimental/tasks/{user}/{task} [delete]
716716
//
717717
// EXPERIMENTAL: This endpoint is experimental and not guaranteed to be stable.
718718
// taskDelete is an experimental endpoint to delete a task by ID.
@@ -733,7 +733,7 @@ func (api *API) taskDelete(rw http.ResponseWriter, r *http.Request) {
733733
return
734734
}
735735
httpapi.Write(ctx,rw,http.StatusInternalServerError, codersdk.Response{
736-
Message:"Internal error fetching workspace.",
736+
Message:"Internal error fetchingtaskworkspace before deleting task.",
737737
Detail:err.Error(),
738738
})
739739
return
@@ -784,10 +784,10 @@ func (api *API) taskDelete(rw http.ResponseWriter, r *http.Request) {
784784
// @Security CoderSessionToken
785785
// @Tags Experimental
786786
// @Param user path string true "Username, user ID, or 'me' for the authenticated user"
787-
// @Paramid path string true "Task ID" format(uuid)
787+
// @Paramtask path string true "Task ID" format(uuid)
788788
// @Param request body codersdk.TaskSendRequest true "Task input request"
789789
// @Success 204 "Input sent successfully"
790-
// @Router /api/experimental/tasks/{user}/{id}/send [post]
790+
// @Router /api/experimental/tasks/{user}/{task}/send [post]
791791
//
792792
// EXPERIMENTAL: This endpoint is experimental and not guaranteed to be stable.
793793
// taskSend submits task input to the tasks sidebar app by dialing the agent
@@ -796,7 +796,7 @@ func (api *API) taskDelete(rw http.ResponseWriter, r *http.Request) {
796796
func (api*API)taskSend(rw http.ResponseWriter,r*http.Request) {
797797
ctx:=r.Context()
798798

799-
idStr:=chi.URLParam(r,"id")
799+
idStr:=chi.URLParam(r,"task")
800800
taskID,err:=uuid.Parse(idStr)
801801
iferr!=nil {
802802
httpapi.Write(ctx,rw,http.StatusBadRequest, codersdk.Response{
@@ -866,17 +866,17 @@ func (api *API) taskSend(rw http.ResponseWriter, r *http.Request) {
866866
// @Security CoderSessionToken
867867
// @Tags Experimental
868868
// @Param user path string true "Username, user ID, or 'me' for the authenticated user"
869-
// @Paramid path string true "Task ID" format(uuid)
869+
// @Paramtask path string true "Task ID" format(uuid)
870870
// @Success 200 {object} codersdk.TaskLogsResponse
871-
// @Router /api/experimental/tasks/{user}/{id}/logs [get]
871+
// @Router /api/experimental/tasks/{user}/{task}/logs [get]
872872
//
873873
// EXPERIMENTAL: This endpoint is experimental and not guaranteed to be stable.
874874
// taskLogs reads task output by dialing the agent directly over the tailnet.
875875
// We enforce ApplicationConnect RBAC on the workspace and validate the sidebar app health.
876876
func (api*API)taskLogs(rw http.ResponseWriter,r*http.Request) {
877877
ctx:=r.Context()
878878

879-
idStr:=chi.URLParam(r,"id")
879+
idStr:=chi.URLParam(r,"task")
880880
taskID,err:=uuid.Parse(idStr)
881881
iferr!=nil {
882882
httpapi.Write(ctx,rw,http.StatusBadRequest, codersdk.Response{

‎coderd/apidoc/docs.go‎

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/apidoc/swagger.json‎

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/coderd.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ func New(options *Options) *API {
10241024
r.Use(httpmw.ExtractOrganizationMembersParam(options.Database,api.HTTPAuth.Authorize))
10251025
r.Post("/",api.tasksCreate)
10261026

1027-
r.Route("/{id}",func(r chi.Router) {
1027+
r.Route("/{task}",func(r chi.Router) {
10281028
r.Use(httpmw.ExtractTaskParam(options.Database))
10291029
r.Get("/",api.taskGet)
10301030
r.Delete("/",api.taskDelete)

‎coderd/httpmw/taskparam.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ func TaskParam(r *http.Request) database.Task {
2323
returntask
2424
}
2525

26-
// ExtractTaskParam grabs a task from the "id" URL parameter by UUID.
26+
// ExtractTaskParam grabs a task from the "task" URL parameter by UUID.
2727
funcExtractTaskParam(db database.Store)func(http.Handler) http.Handler {
2828
returnfunc(next http.Handler) http.Handler {
2929
returnhttp.HandlerFunc(func(rw http.ResponseWriter,r*http.Request) {
3030
ctx:=r.Context()
31-
taskID,parsed:=ParseUUIDParam(rw,r,"id")
31+
taskID,parsed:=ParseUUIDParam(rw,r,"task")
3232
if!parsed {
3333
return
3434
}

‎coderd/httpmw/taskparam_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func TestTaskParam(t *testing.T) {
109109
WorkspaceID: uuid.NullUUID{UUID:workspace.ID,Valid:true},
110110
Prompt:"test prompt",
111111
})
112-
chi.RouteContext(r.Context()).URLParams.Add("id",task.ID.String())
112+
chi.RouteContext(r.Context()).URLParams.Add("task",task.ID.String())
113113
rw:=httptest.NewRecorder()
114114
rtr.ServeHTTP(rw,r)
115115

‎docs/reference/api/experimental.md‎

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp