volume_up

A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More

AI OnAI Off

Overriding UI controller gives errors

An override of the cartscontroller in customerservice gives an "o.data.Results is undefined" in the UI. I need to add some restrictions to the query that is done there, but just the override returning the base query a;ready gives the error, with the output being completely the same

public class CustomCartsController : CartsController
{
    public CustomCartsController(IOrderRepository orderRepository, IMarketService marketService, ICurrentMarket currentMarketService, IOrderGroupCalculator orderGroupCalculator, OrderValidationService orderValidationService, ValidationMessageService validationMessageService, ContactModelFactory contactModelFactory, IOrderGroupFactory orderGroupFactory, OrderGroupModelFactory orderGroupModelFactory, IFeatureSwitch featureSwitch, ICartSearchService cartSearch, IOrderSearchAsyncService orderSearchAsync, OrderActivityHandler<IOrderGroup> orderActivityHandler, IRequiredMetaFieldCollection requiredFields, ReferenceConverter referenceConverter, IContentLoader contentLoader, ThumbnailUrlResolver thumbnailUrlResolver) : base(orderRepository, marketService, currentMarketService, orderGroupCalculator, orderValidationService, validationMessageService, contactModelFactory, orderGroupFactory, orderGroupModelFactory, featureSwitch, cartSearch, orderSearchAsync, orderActivityHandler, requiredFields, referenceConverter, contentLoader, thumbnailUrlResolver)
    {
    }

    [HttpGet]
    [Route("csr/api/carts", Order = -1)]
    public Task<IActionResult> CustomSearch(
        string searchValue,
        string marketIds,
        string status,
        string siteId,
        string createdFrom,
        string createdTo,
        int startingIndex,
        int numberOfRecords,
        string sortField = "",
        string sortType = "")
    {
        return base.Search(searchValue, marketIds, status, siteId, createdFrom, createdTo, startingIndex, numberOfRecords, sortField, sortType);
    }
}

 

#333720
Dec 02, 2024 13:45
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.