mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-15 03:47:37 +00:00
fix: reduce (#635)
* fix: management reduce optimization * fix: reduce optimization * fix: reduce optimization * fix: merge master
This commit is contained in:
@@ -129,6 +129,15 @@ func PutUserGrant(db *gorm.DB, table string, grant *model.UserGrantView) error {
|
||||
return save(db, grant)
|
||||
}
|
||||
|
||||
func PutUserGrants(db *gorm.DB, table string, grants ...*model.UserGrantView) error {
|
||||
save := repository.PrepareBulkSave(table)
|
||||
g := make([]interface{}, len(grants))
|
||||
for i, grant := range grants {
|
||||
g[i] = grant
|
||||
}
|
||||
return save(db, g...)
|
||||
}
|
||||
|
||||
func DeleteUserGrant(db *gorm.DB, table, grantID string) error {
|
||||
delete := repository.PrepareDeleteByKey(table, model.UserGrantSearchKey(grant_model.UserGrantSearchKeyGrantID), grantID)
|
||||
return delete(db)
|
||||
|
Reference in New Issue
Block a user