fix: custom message texts (#2046)

* fix: grpc implementation of custom message texts

* fix: proto definition of RemoveHumanAvatar in mgmt api

* fix: DeleteCustomText in view (respect key)
This commit is contained in:
Livio Amstutz
2021-07-20 11:40:53 +02:00
committed by GitHub
parent 9413fc19ff
commit 413ed80611
12 changed files with 20 additions and 17 deletions

View File

@@ -78,10 +78,11 @@ func PutCustomText(db *gorm.DB, table string, customText *model.CustomTextView)
return save(db, customText)
}
func DeleteCustomText(db *gorm.DB, table, aggregateID, template, lang string) error {
func DeleteCustomText(db *gorm.DB, table, aggregateID, template, lang, key string) error {
aggregateIDSearch := repository.Key{Key: model.CustomTextSearchKey(iam_model.CustomTextSearchKeyAggregateID), Value: aggregateID}
templateSearch := repository.Key{Key: model.CustomTextSearchKey(iam_model.CustomTextSearchKeyTemplate), Value: template}
languageSearch := repository.Key{Key: model.CustomTextSearchKey(iam_model.CustomTextSearchKeyLanguage), Value: lang}
delete := repository.PrepareDeleteByKeys(table, aggregateIDSearch, templateSearch, languageSearch)
keySearch := repository.Key{Key: model.CustomTextSearchKey(iam_model.CustomTextSearchKeyKey), Value: key}
delete := repository.PrepareDeleteByKeys(table, aggregateIDSearch, templateSearch, keySearch, languageSearch)
return delete(db)
}