Ejemplo n.º 1
0
        public async Task <ActionResult <ProductCategory> > Get([Required] Guid id, CancellationToken ct = default)
        {
            var category = await _userCategoriesService.GetAsync(id, false, ct);

            if (category == null)
            {
                return(NotFound(id));
            }

            return(ReturnIfAllowed(category, Roles.Products, category.AccountId));
        }
        public async Task <ActionResult <ProductCategoryChangeGetPagedListResponse> > GetPagedList(
            ProductCategoryChangeGetPagedListRequest request,
            CancellationToken ct = default)
        {
            var category = await _productCategoriesService.GetAsync(request.CategoryId, false, ct);

            var response = await _productCategoryChangesService.GetPagedListAsync(request, ct);

            return(ReturnIfAllowed(response, Roles.Products, category.AccountId));
        }