Ejemplo n.º 1
0
        public async Task <IActionResult> Fetch(string tableName, string clientId, int pageIndex, int pageSize, [FromBody] FilterSortingDto filterSortingDto)
        {
            try
            {
                var data = await _globalGridManager.FindFilteredDataAsync(tableName, clientId, pageIndex, pageSize,
                                                                          filterSortingDto);

                // creating the azioni object passing the related details and description.
                var azioniDto = _utilityManager.GetAzioniDtoObject(User, "get", "AG GRID DATA of " + tableName);
                // logging the activity record by the user.
                await _azioniManager.AzioniInsert(azioniDto);

                return(Ok(data));
            }catch (Exception x)
            {
                var errorObj = await _utilityManager.ReturnErrorObj(x, User, "AG GRID ERROR");

                if (x.Message == "Token Expired")
                {
                    return(Unauthorized());
                }
                return(BadRequest(errorObj));
            }
        }