Example #1
0
        public async Task <ActionResult <OrderToReturnDto> > GetOrderByIdForUser(int id)
        {
            var email = User.RetriveEmailFromPrincipal();

            var order = await _orderService.GetOrderByIdAsync(id, email);

            if (order == null)
            {
                return(NotFound(new ApiResponse(404)));
            }

            return(_mapper.Map <Order, OrderToReturnDto>(order));
        }