fix
This commit is contained in:
@@ -83,12 +83,26 @@ public class CurrencyService
|
||||
|
||||
exists.Name = currency.Name;
|
||||
exists.ShortName = currency.ShortName;
|
||||
exists.IsPrimary = currency.IsPrimary;
|
||||
|
||||
if (!_currencyRepository.Update(exists))
|
||||
{
|
||||
return result.Set(CurrencyEditStatus.failed);
|
||||
}
|
||||
|
||||
if (exists.IsPrimary)
|
||||
{
|
||||
var primaries = _currencyRepository.GetPrimaries(userId);
|
||||
foreach (var primary in primaries)
|
||||
{
|
||||
if (primary.Id != exists.Id)
|
||||
{
|
||||
primary.IsPrimary = false;
|
||||
_currencyRepository.Update(primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result.Set(exists);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user