This commit is contained in:
2023-07-20 21:38:05 +03:00
parent 4bac59f322
commit 2f108bef4f
35 changed files with 1863 additions and 909 deletions
+11 -6
View File
@@ -292,8 +292,8 @@
{
if (motion == null)
throw new ArgumentNullException(nameof(motion));
if (motion.Motion == null)
throw new ArgumentNullException(nameof(motion.Motion));
if (motion.Item == null)
throw new ArgumentNullException(nameof(motion.Item));
var result = new Exec<Motion, MotionAddResult>(MotionAddResult.success);
@@ -303,7 +303,7 @@
return result.Set(MotionAddResult.account_not_found);
}
var itemExec = _itemService.GetOrCreate(userId, motion.Motion);
var itemExec = _itemService.GetOrCreate(userId, motion.Item);
if (itemExec.Status != ItemGetOrAddResult.success)
{
return result.Set(MotionAddResult.failure);
@@ -341,8 +341,8 @@
{
if (motion == null)
throw new ArgumentNullException(nameof(motion));
if (motion.Motion == null)
throw new ArgumentNullException(nameof(motion.Motion));
if (motion.Item == null)
throw new ArgumentNullException(nameof(motion.Item));
var result = new Exec<Motion, MotionUpdateResult>(MotionUpdateResult.success);
@@ -352,7 +352,7 @@
return result.Set(MotionUpdateResult.not_found);
}
var itemExec = _itemService.GetOrCreate(userId, motion.Motion);
var itemExec = _itemService.GetOrCreate(userId, motion.Item);
if (itemExec.Status != ItemGetOrAddResult.success)
{
return result.Set(MotionUpdateResult.failure);
@@ -414,5 +414,10 @@
return result.Set(exists);
}
public List<Account> FindAccounts(Guid userId, string term)
{
return _accountRepository.FindAccounts(userId, term);
}
}
}