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.
 
 
 
 

40 lines
848 B

const moment = require("moment")
const {storyApi} = require("../../../../../rpdata/api/Story")
module.exports = class {
onCreate(input) {
this.state = {
error: null,
loading: false,
}
}
change(key, ev) {
this.state.values[key] = ev.target.value
}
close() {
this.emit("close")
}
addTag(tag) {
this.state.error = null
storyApi.addTag({id: this.input.story.id, tag}).then(({tags}) => {
this.emit("tags", tags)
}).catch(errs => {
this.state.error = errs.message || errs[0].message || "Add tag failed"
})
}
removeTag(tag) {
this.state.error = null
storyApi.removeTag({id: this.input.story.id, tag}).then(({tags}) => {
this.emit("tags", tags)
}).catch(errs => {
this.state.error = errs.message || errs[0].message || "Remove tag failed"
})
}
}