Front-end
- async getFilterData() {
- this.setState({ tableLoading: true });
- const TitleFIlter = document.getElementById("TitleFIlter").value
- const descriptionFilter = document.getElementById("DescriptionFilter").value
- const priceminFIlter = document.getElementById("PriceMin").value
- const pricemaxFIlter = document.getElementById("PriceMax").value
- console.log(" title =" + TitleFIlter);
- console.log("description = " + descriptionFilter);
- console.log(" PriceMin =" + priceminFIlter);
- console.log("PriceMax = " + pricemaxFIlter);
- const url = `api/upload/${TitleFIlter}/${descriptionFilter}/${priceminFIlter}/${pricemaxFIlter}`
- const response = await axios.get(url)
- const data = await response.data;
- this.setState({
- allproducts: data,
- tableLoading: false
- });
- console.log(data);
- }
- HttpGet]
- [Route("{Title?}/{Description?}/{Pricemin?}/{Pricemax?}")]
- public async Task
- > GetFilter([FromQuery]
- string Title,
- string Description,
- int PriceMin,
- int PriceMax
- )
- {
- IQueryable
products = _context.products; - if (!string.IsNullOrEmpty(Title))
- products = products.Where(x => x.Title.ToLower().Contains(Title.ToLower()));
- if (!string.IsNullOrEmpty(Description))
- products = products.Where(x => x.Description.ToLower().Contains(Description.ToLower()));
- if (PriceMin > 0)
- products = products.Where(x => x.Price >= PriceMin);
- if (PriceMax > 0)
- products = products.Where(x => x.Price <= PriceMax);
- return await products.ToListAsync();
- }
How do i solve this

Jishan SiddiqueRank #2,294 · 615 reputationPosted Jun 2, 2021, 12:41 PM EDT
osyris zosarRank #6,574 · 262 reputationPosted Jun 2, 2021, 12:54 PM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Jun 2, 2021, 3:42 PM EDT
> GetFilter([FromQuery]
osyris zosarRank #6,574 · 262 reputationPosted Jun 4, 2021, 9:46 AM EDT
I have chance the url in the front-end to:
entire reactjs (frontend- code):
I think im doing something wrong in the frond-end but im not sure what.
please help me out.