Created
December 6, 2021 23:56
-
-
Save ShariqT/8377413d424d58a8c47fc8d71bb51b6d to your computer and use it in GitHub Desktop.
list-postcards3.vue
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
<script setup> | |
// other code | |
function cancel(id) { | |
fetch(`http://localhost:3030/postcard/cancel/${id}`) | |
.then((data) => data.json()) | |
.then((data) => { | |
if (data.deleted) { | |
postcards.value = postcards.value.filter(postcard => postcard.id !== id) | |
} | |
}); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment