title: how to insert data available for both sender and receiver in solidity?
body: <p>---------Solidity---------<br />
  This is a create request:</p>
  <pre><code>function createRequest(Requests memory rqst) external
  {
          Rqst[msg.sender].push(Requests({
              status:rqst.status,
              amount:rqst.amount,
              description:rqst.description
          }));
  }
  </code></pre>
  <p>This is the get request:</p>
  <pre><code>function getRequest(uint requestIndex) external view returns (Requests memory)
  {
          Requests storage rqst = Rqst[msg.sender][requestIndex];
          return rqst;
  }
  </code></pre>
  <p>---------end of Solidity---------</p>
  <p>---------React.js---------</p>
  <pre><code>  const createRequest =  async () =&gt; {
      await contract.methods.createRequest(['pending',amount, description]).send({ from: defaultAccount });
    }
  </code></pre>
  <p>Note: in createRequest, defaultAccount is the current metamask login, which is the employee.</p>
  <p>This method getRequests is called if the metamask login is the manager.</p>
  <pre><code>  const getRequests =  async (contract, defaultAccount) =&gt; {
      const f = async () =&gt; {
        const len = await contract.methods.getRequestount().call({ from: defaultAccount });
        console.log(&quot;len&quot;,len)
        let iterator = 0
        let contain = []
        while ( iterator &lt;= len) {
          try {
            console.log(&quot;iterator&quot;,iterator)
            let o = await contract.methods.getRequest(String(iterator)).call({ from: defaultAccount });
            if (o[0] !== '') {
              contain.push({
                status: o['status'],
                amount: o['amount'],
                description: o['description']
              })
            }
            else {
              console.log('The index ' + iterator + ' is empty');
            }
          } catch {
            console.log('Failed to get requests ' + iterator);
          }
          iterator++;
        }
        return contain
      }
      let c = await f()
      dispatch(setRequests(c))
    }
  </code></pre>
  <p>----------end of React.js--------</p>
  <p>I am creating a request to my manager.<br />
  The manager has an admin that displays a list of request.</p>
  <p>When I <code>getRequest()</code> web3 returns <code>MetaMask - RPC Error: execution reverted</code>.</p>
  <p>I tried creating request using the manager and then display the requests, it works perfectly.</p>