Skip to content

Commit 7be61cd

Browse files
committed
Fix a few tests
1 parent 7a39d34 commit 7be61cd

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

coderd/database/dbauthz/querier_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ func (s *MethodTestSuite) TestTemplate() {
721721
check.Args(database.UpdateTemplateVersionByIDParams{
722722
ID: tv.ID,
723723
TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true},
724-
}).Asserts(t1, rbac.ActionUpdate).Returns()
724+
}).Asserts(t1, rbac.ActionUpdate).Returns(tv)
725725
}))
726726
s.Run("UpdateTemplateVersionDescriptionByJobID", s.Subtest(func(db database.Store, check *expects) {
727727
jobID := uuid.New()

coderd/templateversions.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ func (api *API) templateVersion(rw http.ResponseWriter, r *http.Request) {
6666
// @Summary Patch template version by ID
6767
// @ID patch-template-version-by-id
6868
// @Security CoderSessionToken
69+
// @Accept json
6970
// @Produce json
7071
// @Tags Templates
7172
// @Param templateversion path string true "Template version ID" format(uuid)

codersdk/templateversions.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ func (c *Client) PreviousTemplateVersion(ctx context.Context, organization uuid.
296296
return version, json.NewDecoder(res.Body).Decode(&version)
297297
}
298298

299-
func (c *Client) UpdateTemplateVersion(ctx context.Context, versionId uuid.UUID, req PatchTemplateVersionRequest) (TemplateVersion, error) {
300-
res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/v2/templateversions/%s", versionId), req)
299+
func (c *Client) UpdateTemplateVersion(ctx context.Context, versionID uuid.UUID, req PatchTemplateVersionRequest) (TemplateVersion, error) {
300+
res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/v2/templateversions/%s", versionID), req)
301301
if err != nil {
302302
return TemplateVersion{}, err
303303
}

0 commit comments

Comments
 (0)