0

Hi guy how should i modified the code to get my search bar actually work? currently my search bar not work correctly.

This is the result of my project

async   onSearch_new(value){
console.log(value);
const {taoBao} = this.state
const url = 'http://rap2api.taobao.org/app/mock/250089/testCompanies'
const response = await fetch(url, {
  method: 'GET',//GET,POST,PUT,DELETE,ETC.
  mode: 'cors',//no-cors, cors, same-origin
  cache: 'no-cache',
  credentials: 'same-origin',
  headers: {
    'Content-Type': 'application/json'
  },
  redirect: 'follow',
  referrerPolicy: 'no-referrer',
   //body: JSON.stringify({
   // company: value.company
  //})
});
response.json().then((data) => {
  console.log(data);
  if (data && data.code == 0) {
    this.setState({
      taoBao: taoBao
    })
  }
  else {
    Next.Notification.error({
      title: 'Fail',
      style: {
        width: 600,
        marginLeft: -255
      }
    });
  }
})
  • Please edit the post to provide details on what you mean it does not work. Specifically, what do you have now, what do you want to have? Saying "it does not work" is too broad and it really does not tell anything specific. – ZygD Sep 28 '22 at 04:26

0 Answers0