This commit is contained in:
2023-07-31 08:50:05 +03:00
parent cca943f37d
commit c5d9ae7b93
49 changed files with 546 additions and 398 deletions
@@ -1,8 +1,8 @@
namespace MyOffice.Web.Controllers;
using AutoMapper;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Authorization;
using Data.Repositories.Currency;
using Models.Currency;
using Services.Currency;
@@ -12,19 +12,22 @@ using Services.Currency;
public class GeneralController : BaseApiController
{
private readonly CurrencyService _currencyService;
private readonly IMapper _mapper;
public GeneralController(
CurrencyService currencyService
CurrencyService currencyService,
IMapper mapper
)
{
_currencyService = currencyService;
_mapper = mapper;
}
[HttpGet("~/api/general/currencies")]
public object Get()
public ObjectResult Get()
{
var list = _currencyService.GetGlobalAll();
return list.Select(x => x.ToModel());
return Ok(_mapper.Map<List<CurrencyGlobalViewModel>>(list));
}
}