The frontend/UI server, written in JS using the MarkoJS library
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
const {commentApi} = require("../../../../../rpdata/api/Comment")
module.exports = class { onCreate(input) { this.state = { error: null, loading: false, values: { title: "", source: "", fictionalDate: "", }, } }
change(key, ev) { this.state.values[key] = ev.target.value }
close() { this.emit("close") }
doIt() { commentApi.removeComment({commentId: this.input.comment.id}).then(() => { this.emit("remove") this.emit("close") }).catch(errs => { console.warn("Failed to delete:", errs)
this.state.error = "Failed to delete: " + errs.message || errs[0].message }).then(() => { this.state.loading = false }) } }
|