mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-03 17:37:53 +02:00
fix build and lint errors
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user