score:0

Accepted answer
  componentDidMount() {
    fetch("https://www.hatchways.io/api/assessment/work_orders")
      .then(response => response.json())
      .then(data => {
        this.setState({
          ordersData: data.orders
        });
      })
      .then(() => {
        this.state.ordersData.forEach(order => {
          console.log(this.state.ordersData);
          fetch(
            `https://www.hatchways.io/api/assessment/workers/${order.workerId}`
          )
            .then(result=> result.json())
            .then(data2 => {
              this.setState(prevState => ({
                workersDatas: [data2, ...prevState.workersDatas]
              }));
            });
          console.log(this.state.workersDatas);
        });
      })
      .catch(err => {
        console.log(err);
      });
  }

Related Query

More Query from same tag