Rework dictionary CRUD operations (#13688)
* Rework dictionary CRUD operations * Update OpenAPI json * Move responsibility to localization service, introduce new attempt pattern for create and update operations, update unit tests accordingly * Fix merge * Rollback assumption that we can map entities from scratch (entity relations got in the way) * Update OpenAPI JSON * Add breakage supressions * Add compat suppressions for integration test project * Make dictionary item deletion follow same pattern as create and update * Review comments + update delete to use new pattern * Update breakage suppressions to match the new Delete method
This commit is contained in:
@@ -240,9 +240,10 @@ public class ScopedRepositoryTests : UmbracoIntegrationTest
|
||||
var lang = new Language("fr-FR", "French (France)");
|
||||
service.Save(lang);
|
||||
|
||||
var item = (IDictionaryItem)new DictionaryItem("item-key");
|
||||
item.Translations = new IDictionaryTranslation[] { new DictionaryTranslation(lang.Id, "item-value") };
|
||||
service.Save(item);
|
||||
var item = service.Create(
|
||||
"item-key",
|
||||
null,
|
||||
new IDictionaryTranslation[] { new DictionaryTranslation(lang.Id, "item-value") }).Result!;
|
||||
|
||||
// Refresh the cache manually because we can't unbind
|
||||
service.GetDictionaryItemById(item.Id);
|
||||
@@ -266,7 +267,7 @@ public class ScopedRepositoryTests : UmbracoIntegrationTest
|
||||
Assert.AreNotSame(globalCache, scopedCache);
|
||||
|
||||
item.ItemKey = "item-changed";
|
||||
service.Save(item);
|
||||
service.Update(item);
|
||||
|
||||
// scoped cache contains the "new" entity
|
||||
var scopeCached = (IDictionaryItem)scopedCache.Get(GetCacheIdKey<IDictionaryItem>(item.Id), () => null);
|
||||
|
||||
Reference in New Issue
Block a user