From 25f539b65f6adb359e6f5588dd74d51b89e5c49c Mon Sep 17 00:00:00 2001 From: zhu327 Date: Thu, 28 Dec 2023 11:53:13 +0800 Subject: [PATCH] fix group delete --- pkg/database/dao/group_resource_policy.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/database/dao/group_resource_policy.go b/pkg/database/dao/group_resource_policy.go index 647c2dba..1f6e44a0 100644 --- a/pkg/database/dao/group_resource_policy.go +++ b/pkg/database/dao/group_resource_policy.go @@ -216,6 +216,10 @@ func (m *groupResourcePolicyManager) BulkDeleteByGroupPKsWithTx( tx *sqlx.Tx, groupPKs []int64, ) error { + if len(groupPKs) == 0 { + return nil + } + sql := `DELETE FROM rbac_group_resource_policy WHERE group_pk IN (?)` return database.SqlxDeleteWithTx(tx, sql, groupPKs) }