Skip to content

Commit 3d3ab7e

Browse files
committed
Improve comments
1 parent ee759ee commit 3d3ab7e

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

coderd/projects.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type projects struct {
5050
Database database.Store
5151
}
5252

53-
// allProjects lists all projects across organizations for a user.
53+
// Lists all projects the authenticated user has access to.
5454
func (p *projects) allProjects(rw http.ResponseWriter, r *http.Request) {
5555
apiKey := httpmw.APIKey(r)
5656
organizations, err := p.Database.GetOrganizationsByUserID(r.Context(), apiKey.UserID)
@@ -78,7 +78,7 @@ func (p *projects) allProjects(rw http.ResponseWriter, r *http.Request) {
7878
render.JSON(rw, r, projects)
7979
}
8080

81-
// allProjectsForOrganization lists all projects for a specific organization.
81+
// Lists all projects in an organization.
8282
func (p *projects) allProjectsForOrganization(rw http.ResponseWriter, r *http.Request) {
8383
organization := httpmw.OrganizationParam(r)
8484
projects, err := p.Database.GetProjectsByOrganizationIDs(r.Context(), []string{organization.ID})
@@ -95,7 +95,7 @@ func (p *projects) allProjectsForOrganization(rw http.ResponseWriter, r *http.Re
9595
render.JSON(rw, r, projects)
9696
}
9797

98-
// createProject makes a new project in an organization.
98+
// Creates a new project in an organization.
9999
func (p *projects) createProject(rw http.ResponseWriter, r *http.Request) {
100100
var createProject CreateProjectRequest
101101
if !httpapi.Read(rw, r, &createProject) {
@@ -141,15 +141,15 @@ func (p *projects) createProject(rw http.ResponseWriter, r *http.Request) {
141141
render.JSON(rw, r, project)
142142
}
143143

144-
// project returns a single project parsed from the URL path.
144+
// Returns a single project.
145145
func (*projects) project(rw http.ResponseWriter, r *http.Request) {
146146
project := httpmw.ProjectParam(r)
147147

148148
render.Status(r, http.StatusOK)
149149
render.JSON(rw, r, project)
150150
}
151151

152-
// allProjectHistory lists all history for a single project.
152+
// Lists history for a single project.
153153
func (p *projects) allProjectHistory(rw http.ResponseWriter, r *http.Request) {
154154
project := httpmw.ProjectParam(r)
155155

@@ -171,9 +171,9 @@ func (p *projects) allProjectHistory(rw http.ResponseWriter, r *http.Request) {
171171
render.JSON(rw, r, apiHistory)
172172
}
173173

174-
// createProjectHistory adds a new historical version of a project.
175-
// An import job is queued to parse the storage method provided.
176-
// Once completed, the import job will specify the version as latest.
174+
// Creates a new version of the project. An import job is queued to parse
175+
// the storage method provided. Once completed, the import job will specify
176+
// the version as latest.
177177
func (p *projects) createProjectHistory(rw http.ResponseWriter, r *http.Request) {
178178
var createProjectVersion CreateProjectVersionRequest
179179
if !httpapi.Read(rw, r, &createProjectVersion) {

coderd/users.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ func (users *users) createInitialUser(rw http.ResponseWriter, r *http.Request) {
135135
render.JSON(rw, r, convertUser(user))
136136
}
137137

138+
// Creates a new user.
138139
func (users *users) createUser(rw http.ResponseWriter, r *http.Request) {
139140
var createUser CreateUserRequest
140141
if !httpapi.Read(rw, r, &createUser) {

0 commit comments

Comments
 (0)