-
-
Save ofirdagan/e73384716382d668b82538a2b5cc28bb to your computer and use it in GitHub Desktop.
Velo Workshop - Step 2 solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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