mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-03 02:21:17 +02:00
add UpdateGroup function
This commit is contained in:
1 parent
11b5e75b92
commit
f3199df895
1 file changed
+6
@@ -322,6 +322,12 @@ func ParentGroupCond(idStr string, groupID int64) builder.Cond {
|
|||||||
return builder.In(idStr, groupList)
|
return builder.In(idStr, groupList)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func UpdateGroup(ctx context.Context, group *Group) error {
|
||||||
|
sess := db.GetEngine(ctx)
|
||||||
|
_, err := sess.Table(group.TableName()).ID(group.ID).Update(group)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
func MoveGroup(ctx context.Context, group *Group, newParent int64, newSortOrder int) error {
|
func MoveGroup(ctx context.Context, group *Group, newParent int64, newSortOrder int) error {
|
||||||
sess := db.GetEngine(ctx)
|
sess := db.GetEngine(ctx)
|
||||||
ng, err := GetGroupByID(ctx, newParent)
|
ng, err := GetGroupByID(ctx, newParent)
|
||||||
|
|||||||
Reference in new issue
Block a user