Hi,
Its not working , I think my code is not totally right, pls help
this is my code
import wixData from ‘wix-data’;
export function button34_click(event, $w) {
if ($w(“#dynamicDataset”).getCurrentItem()) {
wixData.remove(“Profile”, “itemId”)
.then( (results) => {
let item = results; //see item below
} )
.catch( (err) => {
let errorMsg = err;
} );
}
}
this is the error when i run in preview
DatasetError: Operation (getCurrentItem) not allowed on an unconfigured datasetremove operation failed: DatasetError: The dataset didn’t load yet. You need to call remove inside the onReady for the dataset.