Download static/js/deletePost.js from zaanind/simplz: direct link, hf CLI and curl.
- Browser
- Download file 493 Bytes
-
https://huggingface.co/spaces/zaanind/simplz/resolve/main/static/js/deletePost.js
- Command line
-
hf download hf://spaces/zaanind/simplz/static/js/deletePost.js
-
curl -L -o deletePost.js https://huggingface.co/spaces/zaanind/simplz/resolve/main/static/js/deletePost.js
493 Bytes
| function deletePost(postId) { | |
| fetch(`/delete_post/${postId}`, { method: 'POST' }) | |
| .then((response) => { | |
| if (response.ok) { | |
| const postElement = document.querySelector(`.post[data-post-id="${postId}"]`); | |
| if (postElement) { | |
| postElement.remove(); | |
| } | |
| } else { | |
| console.error('Error deleting post:', response); | |
| } | |
| }) | |
| .catch((error) => { | |
| console.error('Error deleting post:', error); | |
| }); | |
| } |