fix
This commit is contained in:
@@ -31,7 +31,26 @@ public class SettingsAccountController : BaseApiController
|
||||
{
|
||||
var list = _accountService.GetAllCategories(UserId);
|
||||
|
||||
return list.Select(x => x.ToModel());
|
||||
return list.OrderBy(x => x.Name).Select(x => x.ToModel());
|
||||
}
|
||||
|
||||
[HttpGet("~/api/settings/account-categories/{id}")]
|
||||
public object AccountCategory(string id)
|
||||
{
|
||||
var exec = _accountService.GetCategory(UserId, id.AsGuid());
|
||||
|
||||
switch (exec.Status)
|
||||
{
|
||||
case GeneralExecStatus.not_found:
|
||||
case GeneralExecStatus.failure:
|
||||
return ProblemBadRequest("Account category not found.");
|
||||
|
||||
case GeneralExecStatus.success:
|
||||
return exec.Result!.ToModel();
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(exec.Status.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost("~/api/settings/account-categories")]
|
||||
@@ -98,7 +117,9 @@ public class SettingsAccountController : BaseApiController
|
||||
? _accountService.GetByCategory(UserId, category!.AsGuid())
|
||||
: _accountService.GetAllAccounts(UserId);
|
||||
|
||||
return list.Select(x => x.ToModel());
|
||||
return list
|
||||
.OrderBy(x => x.Name)
|
||||
.Select(x => x.ToModel());
|
||||
}
|
||||
|
||||
[HttpPost("~/api/settings/accounts")]
|
||||
|
||||
Reference in New Issue
Block a user