fix
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
namespace MyOffice.Web.Controllers;
|
||||
|
||||
using AutoMapper;
|
||||
using Core;
|
||||
using Core.Extensions;
|
||||
using Data.Models.Currencies;
|
||||
using Infrastructure.Attributes;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Models.Currency;
|
||||
@@ -92,6 +94,25 @@ public class CurrencyController : BaseApiController
|
||||
}
|
||||
}
|
||||
|
||||
[HttpDelete("~/api/settings/currencies/{id}")]
|
||||
public ObjectResult Update([AsGuid] string id)
|
||||
{
|
||||
var exec = _currencyService.Remove(UserId, id.AsGuid());
|
||||
|
||||
switch (exec.Status)
|
||||
{
|
||||
case GeneralExecStatus.success:
|
||||
return OkResponse(_mapper.Map<CurrencyViewModel>(exec.Result!));
|
||||
|
||||
case GeneralExecStatus.not_found:
|
||||
case GeneralExecStatus.failure:
|
||||
return ProblemBadResponse("Currency not found.");
|
||||
|
||||
default:
|
||||
throw new NotSupportedException(exec.Status.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
[HttpPost("~/api/settings/currencies/{id}/rate")]
|
||||
public ObjectResult Add(string id, CurrencyRateModel currencyRate)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user