fix: reduce (#635)

* fix: management reduce optimization

* fix: reduce optimization

* fix: reduce optimization

* fix: merge master
This commit is contained in:
Fabi
2020-08-26 13:01:37 +02:00
committed by GitHub
parent 87aa97b9c7
commit 4af38b37a6
29 changed files with 184 additions and 63 deletions

View File

@@ -63,9 +63,18 @@ func SearchProjectGrants(db *gorm.DB, table string, req *proj_model.ProjectGrant
return projectGrants, count, err
}
func PutProjectGrant(db *gorm.DB, table string, project *model.ProjectGrantView) error {
func PutProjectGrant(db *gorm.DB, table string, grant *model.ProjectGrantView) error {
save := repository.PrepareSave(table)
return save(db, project)
return save(db, grant)
}
func PutProjectGrants(db *gorm.DB, table string, grants ...*model.ProjectGrantView) error {
save := repository.PrepareBulkSave(table)
g := make([]interface{}, len(grants))
for i, grant := range grants {
g[i] = grant
}
return save(db, g...)
}
func DeleteProjectGrant(db *gorm.DB, table, grantID string) error {