Skip to content

Instantly share code, notes, and snippets.

@ofirdagan
Created July 17, 2022 15:52
Show Gist options
  • Save ofirdagan/e73384716382d668b82538a2b5cc28bb to your computer and use it in GitHub Desktop.
Save ofirdagan/e73384716382d668b82538a2b5cc28bb to your computer and use it in GitHub Desktop.
Velo Workshop - Step 2 solution
import wixData from 'wix-data';
$w.onReady(async () => {
try {
const results = await wixData.query("services").find();
$w('#services').data = results.items;
$w("#services").onItemReady(($item, itemData, index) => {
$item("#name").text = itemData.name;
$item("#delete").onClick(async () => {
await wixData.remove("services", itemData._id);
$item('#item').hide();
});
});
} catch (e) {
console.log(`Error: `, e);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment