public IActionResult ApproveEditRequest(int editRequestId, bool isRedirectToMaterial)
        {
            var loggedModerator = _userService.FindByIdentityUserId(User.FindFirstValue(ClaimTypes.NameIdentifier));

            var editRequest = _materialsService.GetEditRequest(editRequestId);

            if (editRequest == null)
            {
                return(RedirectToAction("ResourceNotFound", "Error", new { error = "sugestia edycji o podanym Id nie istnieje." }));
            }

            try
            {
                int materialToUpdateId = editRequest.MaterialToUpdateId;
                _materialsService.ApproveEditRequest(editRequest);
                _filesManagement.ReplaceMaterialFilesWithEditRequestFiles(materialToUpdateId, editRequest.EditRequestId, editRequest.Files);
            }
            catch (ArgumentException)
            {
                return(RedirectToAction("ResourceNotFound", "Error", new { error = "sugestia edycji o podanym Id nie istnieje." }));
            }
            catch (Exception)
            {
                _filesManagement.RemoveFilesFromFileSystem(editRequest.Files);
                return(BadRequest("Coś poszło nie tak podczas zapisywania plików. Spróbuj ponownie."));
            }

            if (isRedirectToMaterial)
            {
                return(RedirectToAction("Material", "Materials", new { area = "Main", materialId = editRequest.MaterialToUpdateId }));
            }

            return(RedirectToAction("EditSuggestions"));
        }