Пример #1
0
        public async Task <IActionResult> PostProductTabAsync([FromBody] ProductTabModel tab)
        {
            if (!await productsRepository.IsProductSellerAsync(tab.ProductId, int.Parse(User.Identity.Name)))
            {
                return(BadRequest());
            }

            return(Ok(await productsRepository.AddProductTabAsync(tab)));
        }
Пример #2
0
        public async Task <IActionResult> PostProductTabAsync([FromBody] MProductTab tab)
        {
            if (!User.IsInRole(RoleConstants.AdminRoleId) && !await productsRepository.IsProductSellerAsync(tab.ProductId, int.Parse(User.Identity.Name)))
            {
                return(BadRequest());
            }

            return(Ok(await productsRepository.AddProductTabAsync(tab)));
        }