✨ Added a new button to delete a post
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { AnimeNotifier } from "../AnimeNotifier"
|
||||
import {AnimeNotifier} from "../AnimeNotifier"
|
||||
|
||||
// Edit post
|
||||
export function editPost(arn: AnimeNotifier, element: HTMLElement) {
|
||||
@ -43,6 +43,20 @@ export function savePost(arn: AnimeNotifier, element: HTMLElement) {
|
||||
.catch(err => arn.statusMessage.showError(err))
|
||||
}
|
||||
|
||||
// Create thread
|
||||
export function deletePost(arn: AnimeNotifier, element: HTMLElement) {
|
||||
|
||||
if (!confirm(`Are you sure you want to delete this Post?`)) {
|
||||
return
|
||||
}
|
||||
|
||||
let endpoint = arn.findAPIEndpoint(element)
|
||||
|
||||
arn.post(endpoint + "/delete", "")
|
||||
.then(() => arn.reloadContent())
|
||||
.catch(err => arn.statusMessage.showError(err))
|
||||
}
|
||||
|
||||
// Forum reply
|
||||
export function forumReply(arn: AnimeNotifier) {
|
||||
let textarea = arn.app.find("new-reply") as HTMLTextAreaElement
|
||||
|
Reference in New Issue
Block a user