summaryrefslogtreecommitdiffstats
path: root/server/model/tag.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/model/tag.js')
-rw-r--r--server/model/tag.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/server/model/tag.js b/server/model/tag.js
new file mode 100644
index 0000000..bc8a4db
--- /dev/null
+++ b/server/model/tag.js
@@ -0,0 +1,18 @@
+const { BeanModel } = require("redbean-node/dist/bean-model");
+
+class Tag extends BeanModel {
+
+ /**
+ * Return an object that ready to parse to JSON
+ * @returns {object} Object ready to parse
+ */
+ toJSON() {
+ return {
+ id: this._id,
+ name: this._name,
+ color: this._color,
+ };
+ }
+}
+
+module.exports = Tag;