1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Move fix to storage layer

Don't know if this is the better way but works.
This commit is contained in:
Cheerpipe 2021-06-08 12:27:53 -04:00
parent ccbb57f88b
commit 6bf6374e00
2 changed files with 2 additions and 1 deletions

View File

@ -41,6 +41,7 @@ namespace Artemis.Storage.Repositories
public ProfileCategoryEntity IsUnique(string name, Guid? id)
{
name = name.Trim();
if (id == null)
return _repository.FirstOrDefault<ProfileCategoryEntity>(p => p.Name == name);
return _repository.FirstOrDefault<ProfileCategoryEntity>(p => p.Name == name && p.Id != id.Value);

View File

@ -50,7 +50,7 @@ namespace Artemis.UI.Screens.Sidebar.Dialogs
private bool BeUniqueCategory(SidebarCategoryCreateViewModel viewModel, string categoryName)
{
return _profileCategoryRepository.IsUnique(categoryName.Trim(), null) == null;
return _profileCategoryRepository.IsUnique(categoryName, null) == null;
}
}
}