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.

25 lines
586 B

  1. const {query} = require("../client")
  2. class Post {
  3. /**
  4. * @param {string} id
  5. * @param {number} position
  6. * @param {Date | string | number} time
  7. * @param {string} kind
  8. * @param {string} nick
  9. * @param {string} text
  10. */
  11. constructor(id, position, time, kind, nick, text) {
  12. this.id = id
  13. this.position = position
  14. this.time = new Date(time)
  15. this.kind = kind
  16. this.nick = nick
  17. this.text = text
  18. }
  19. static fromData(data) {
  20. return new Post(data.id, data.position, data.time, data.kind, data.nick, data.text)
  21. }
  22. }
  23. module.exports = {Post}