fix build and lint errors

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧
2026-04-02 20:00:54 -04:00
parent 52f6c9bc45
commit 271b6c7cae
20 changed files with 89 additions and 18 deletions
+11 -5
View File
@@ -1,13 +1,16 @@
// Copyright 2025 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package group
import (
access_model "code.gitea.io/gitea/models/perm/access"
shared_group_model "code.gitea.io/gitea/models/shared/group"
"fmt"
"errors"
"net/http"
"strings"
group_model "code.gitea.io/gitea/models/group"
access_model "code.gitea.io/gitea/models/perm/access"
shared_group_model "code.gitea.io/gitea/models/shared/group"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/web"
"code.gitea.io/gitea/services/context"
@@ -18,7 +21,7 @@ import (
func createCommonGroup(ctx *context.APIContext, parentGroupID, ownerID int64) (*api.Group, error) {
if ownerID < 1 {
if parentGroupID < 1 {
return nil, fmt.Errorf("cannot determine new group's owner")
return nil, errors.New("cannot determine new group's owner")
}
npg, err := group_model.GetGroupByID(ctx, parentGroupID)
if err != nil {
@@ -153,7 +156,10 @@ func MoveGroup(ctx *context.APIContext) {
npos = *form.NewPos
}
err = group_service.MoveGroupItem(ctx, group_service.MoveGroupOptions{
form.NewParent, id, true, npos,
NewParent: form.NewParent,
ItemID: id,
IsGroup: true,
NewPos: npos,
}, ctx.Doer)
if group_model.IsErrGroupNotExist(err) {
ctx.APIErrorNotFound()
+2 -1
View File
@@ -1304,7 +1304,8 @@ func MoveRepoToGroup(ctx *context.APIContext) {
npos = *form.NewPos
}
err := group_service.MoveGroupItem(ctx, group_service.MoveGroupOptions{
IsGroup: false, NewPos: npos,
IsGroup: false,
NewPos: npos,
ItemID: ctx.Repo.Repository.ID,
NewParent: form.NewParent,
}, ctx.Doer)
+3
View File
@@ -1,3 +1,6 @@
// Copyright 2025 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package swagger
import api "code.gitea.io/gitea/modules/structs"