score:1
in your current for
implementation, if extracting fails in the middle of the operation, you are not going to get all places, you will get some of them. instead
let places
try{
// check if placeid is a string or number. i think should be string
const placeid = await prenotationcontract.methods.placeid().call()
places = await promise.all(
// since your for loop is till placeid
array(parseint(placeid))
.fill()
.map((element, index) => {
// since places is public, solidity assgins a getter automatically
return prenotationcontract.methods.places(index).call();
})
);
} catch (e) {
console.log("error in extracting places", e);
}
Source: stackoverflow.com
Related Query
- How to retrieve SmartContract details in react
- How can I programmatically set the user details for Launch Darkly in my react app
- How to focus a button in a details list using React and Office Fabric
- How to retrieve the parameter after a hash (#) with React Router and useParams hook?
- How retrieve current redux-form state field value in react class form component?
- How to retrieve data from custom attribute on option tag in React
- how to show details page using react router dom
- React Redux - how to load details if the array is not yet obtained?
- React, how to pass product id to details page with React Router Dom?
- How to retrieve authorized information from Fantasy Premier League using React
- How to set a dynamic class in react js and retrieve it in Jquery
- How to retrieve data from promise object in React JS
- How to correctly type a null value in typescript react app, retrieved from an JSON object (api call) when using Object.entries to retrieve the value?
- How to retrieve a value from API in react js
- How do I configure axios in react to retrieve data with an objects id from an api?
- How to retrieve a React property from an event object
- How to retrieve Azure Key Vault in React JS
- React JS : How to retrieve a string variable from a function using componentDidMount()
- How can display one or more details in one component - React Native?
- Socket.io - React : How to retrieve saved socket.io data (MongoDB) in React?
- React - how to create a dynamic (using router) details pages
- How to retrieve and map through items of a specific category with Django and react
- How to retrieve state from local storage on react
- Microsoft Graph Toolkit - How to insert additional details in Person Card using React
- How to retrieve the text from a className in react
- How to retrieve selectedRows from a material-table in React
- How to retrieve a React component from an object property
- How to get details of specific item/object from an array based on it's property id - React
- How can I pass the user details on submit using React js
- How to display EditText details below Labels in React js?
More Query from same tag
- Is there any function to get form value in react-final-form
- i want react hook cascading select option
- how do i send FormData to the node server from React js axios post request?
- TypeError: this.activateMode is not a function (Gutenberg WordPress)
- How to pass React component as a child and add props inside this conponent
- CSS not rendered correctly
- React Full calendar Change View API
- How to set the default value for input type number
- HTML5 File upload using .NET Core 2.0 Web api
- Removing an specific item from an array in React
- How do I conditionally render part of my CSS class
- Styled components select previous sibling
- useEffect changing the desired variable but no effect React
- Add class on parent div - React TypeScript
- Create async thunk loosing context if returned from another functions
- InnerBlocks with template returning a block count of zero
- Ant design table filter: How to limit to one selection in the filter
- NextJS Router.push not working for certain use cases
- Create react component dynamically
- Export two constants from one component to another
- Need to know how to use the spread operator for an object
- How to add Link/ a tag in the options of dropdown in React
- Redirect in React Router Dom v6
- ReactJS: Disable mouse events in child components of parent
- How to properly erase an element from a React state array?
- Passing values into the `next` function in Redux Saga
- How can set my state once when listening resize event
- Can rematch immer plugin control auto freeze switch just like immer using setAutoFreeze(true/false)?
- Can I customize text color of a React-Bootstrap Form Control input textbox?
- How to get div or element height in ReactJS