mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-22 20:50:48 +00:00
more formatting fixes
This commit is contained in:
parent
24babd6ca1
commit
58e56cd0c6
@ -15,10 +15,7 @@ import (
|
||||
"code.gitea.io/gitea/services/convert"
|
||||
)
|
||||
|
||||
func innerCreateProject(
|
||||
ctx *context.APIContext,
|
||||
projectType project_model.Type,
|
||||
) {
|
||||
func innerCreateProject(ctx *context.APIContext, projectType project_model.Type) {
|
||||
form := web.GetForm(ctx).(*api.NewProjectPayload)
|
||||
project := &project_model.Project{
|
||||
RepoID: 0,
|
||||
@ -290,9 +287,7 @@ func ListUserProjects(ctx *context.APIContext) {
|
||||
Type: project_model.TypeIndividual,
|
||||
IsClosed: ctx.FormOptionalBool("closed"),
|
||||
OwnerID: ctx.Doer.ID,
|
||||
ListOptions: db.ListOptions{
|
||||
Page: ctx.FormInt("page"),
|
||||
},
|
||||
ListOptions: db.ListOptions{Page: ctx.FormInt("page")},
|
||||
})
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "Projects", err)
|
||||
@ -344,9 +339,7 @@ func ListOrgProjects(ctx *context.APIContext) {
|
||||
// "$ref": "#/responses/notFound"
|
||||
projects, count, err := db.FindAndCount[project_model.Project](ctx, project_model.SearchOptions{
|
||||
OwnerID: ctx.Org.Organization.AsUser().ID,
|
||||
ListOptions: db.ListOptions{
|
||||
Page: ctx.FormInt("page"),
|
||||
},
|
||||
ListOptions: db.ListOptions{Page: ctx.FormInt("page")},
|
||||
IsClosed: ctx.FormOptionalBool("closed"),
|
||||
Type: project_model.TypeOrganization,
|
||||
})
|
||||
@ -407,9 +400,7 @@ func ListRepoProjects(ctx *context.APIContext) {
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
IsClosed: ctx.FormOptionalBool("closed"),
|
||||
Type: project_model.TypeRepository,
|
||||
ListOptions: db.ListOptions{
|
||||
Page: ctx.FormInt("page"),
|
||||
},
|
||||
ListOptions: db.ListOptions{Page: ctx.FormInt("page")},
|
||||
})
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "Projects", err)
|
||||
|
@ -149,9 +149,7 @@ func TestAPIUpdateProject(t *testing.T) {
|
||||
token := getUserToken(t, "user2", auth_model.AccessTokenScopeWriteUser, auth_model.AccessTokenScopeWriteIssue)
|
||||
link, _ := url.Parse(fmt.Sprintf("/api/v1/projects/%d", 1))
|
||||
|
||||
req := NewRequestWithJSON(t, "PATCH", link.String(), &api.UpdateProjectPayload{
|
||||
Title: "First project updated",
|
||||
}).AddTokenAuth(token)
|
||||
req := NewRequestWithJSON(t, "PATCH", link.String(), &api.UpdateProjectPayload{Title: "First project updated"}).AddTokenAuth(token)
|
||||
|
||||
var apiProject *api.Project
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user