This commit is contained in:
2023-06-21 17:56:00 +03:00
parent fa8852a32a
commit e9d4053e65
55 changed files with 3883 additions and 262 deletions
+10 -5
View File
@@ -32,7 +32,10 @@ public class SettingsMotionController : BaseApiController
{
var list = _motionService.GetAllCategories(UserId);
return list.Select(x => x.ToModel()).OrderByDescending(x => x.SortOrder);
return list
.Select(x => x.ToModel())
.OrderByDescending(x => x.SortOrder)
.ThenBy(x => x.Name);
}
[HttpPost("~/api/settings/motion-categories")]
@@ -42,7 +45,7 @@ public class SettingsMotionController : BaseApiController
switch (exec.Status)
{
case GeneralExecStatus.success:
return exec.Result!;
return exec.Result!.ToModel();
case GeneralExecStatus.failure:
case GeneralExecStatus.not_found:
@@ -60,7 +63,7 @@ public class SettingsMotionController : BaseApiController
switch (exec.Status)
{
case GeneralExecStatus.success:
return exec.Result!;
return exec.Result!.ToModel();
case GeneralExecStatus.failure:
case GeneralExecStatus.not_found:
@@ -97,9 +100,11 @@ public class SettingsMotionController : BaseApiController
{
var list = category.IsMissing()
? _motionService.GetAll(UserId)
: _motionService.GetByCategory(UserId, category.AsGuid());
: _motionService.GetByCategory(UserId, category!.AsGuid());
return list.Select(x => x.ToModel());
return list
.OrderBy(x => x.MotionGlobal.Name)
.Select(x => x.ToModel());
}
[HttpPut("~/api/settings/motions/{id}")]