master
Evan Chen 2021-12-24 22:45:28 +08:00
parent 0d58e402f8
commit 9b3f3fcc62
1 changed files with 2 additions and 2 deletions

View File

@ -37,9 +37,9 @@ func HasEventAccess(c *gin.Context, e *Event, cid string) error {
func ChangeCalGroup(cal_id, to string) error { func ChangeCalGroup(cal_id, to string) error {
return db.Transaction(func(tx *gorm.DB) 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 = ? select id from groups where name = ?
) where calendar_id = ?`, to, cal_id).RowsAffected ) where id = ?`, to, cal_id).RowsAffected
if affected == 0 { if affected == 0 {
return errors.ErrorNotFound return errors.ErrorNotFound
} }