From 9b3f3fcc62e3e004cb118b3178228d68a6a9d479 Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Fri, 24 Dec 2021 22:45:28 +0800 Subject: [PATCH] update --- calendar/util.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/calendar/util.go b/calendar/util.go index 62dd906..e853866 100644 --- a/calendar/util.go +++ b/calendar/util.go @@ -37,9 +37,9 @@ func HasEventAccess(c *gin.Context, e *Event, cid string) error { func ChangeCalGroup(cal_id, to string) error { return db.Transaction(func(tx *gorm.DB) error { - affected := tx.Exec(`update events set group_id = ( + affected := tx.Exec(`update calendars set group_id = ( select id from groups where name = ? - ) where calendar_id = ?`, to, cal_id).RowsAffected + ) where id = ?`, to, cal_id).RowsAffected if affected == 0 { return errors.ErrorNotFound }