Skip to content

Commit 07a1c25

Browse files
add UpdateGroup function
1 parent 0051aaa commit 07a1c25

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

models/group/group.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,12 @@ func ParentGroupCond(idStr string, groupID int64) builder.Cond {
322322
return builder.In(idStr, groupList)
323323
}
324324

325+
func UpdateGroup(ctx context.Context, group *Group) error {
326+
sess := db.GetEngine(ctx)
327+
_, err := sess.Table(group.TableName()).ID(group.ID).Update(group)
328+
return err
329+
}
330+
325331
func MoveGroup(ctx context.Context, group *Group, newParent int64, newSortOrder int) error {
326332
sess := db.GetEngine(ctx)
327333
ng, err := GetGroupByID(ctx, newParent)

0 commit comments

Comments
 (0)