I am using this code in my webpart to insert into the sharepoint list with list name, but moving this code into production environment is creating an issue since its forming the wrong url for inserting into the list, The url in production is https://abcportal.sharepoint.com/sites/SolutionBook/SitePages/_api/web/lists/getByTitle('Smart%20City%20IAQ%20Demo%20Requests')?$select=ListItemEntityTypeFullName
But in local environment is working fine it forms this url https://abcportal.sharepoint.com/sites/solutionbooktest/_api/web/lists/getByTitle('Smart City IAQ Demo Requests')/items
In the production environment URL SitePages is coming automatically, how to remove it?
-------Code--------- public insertEmailToList() {
pnp.sp.web.lists.getByTitle("Smart City IAQ Demo Requests").items.add({
Title: this.state.Email
}).then(r => {
this.setState({ ButtonActive: false });
});
}
or Is there any way to insert into sharepoint list using URL of the list?