Fixed a bug in the Link model

This commit is contained in:
2022-12-27 17:58:00 +01:00
parent fefe6d1fb3
commit fe08c1ddf2

View File

@ -20,9 +20,9 @@ module.exports = db.define("links", {
},
tags: {
type: Sequelize.STRING,
defaultValue: "",
allowNull: true,
get() {
return this.getDataValue('tags').split(',');
return this.getDataValue('tags')?.split(',');
},
set(val) {
this.setDataValue('tags', val.join(','));