From 8fd76b88b6146512681c1ed42194ac145cbe01f6 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Thu, 19 Jan 2017 12:26:57 +0000 Subject: [PATCH] Store types --- common/mod.js | 6 +++--- webapp/models/database.js | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/mod.js b/common/mod.js index b9c91d6..079b6b7 100644 --- a/common/mod.js +++ b/common/mod.js @@ -2,14 +2,14 @@ var ModType = { mod: "mod", - modpack: "modpack", - game: "game" + game: "game", + texturepack: "texturepack" } class Mod { constructor(author) { this.author = author || null - this.type = "1" + this.type = null this.basename = null this.title = null this.description = "" diff --git a/webapp/models/database.js b/webapp/models/database.js index 6e71341..c5ed06d 100644 --- a/webapp/models/database.js +++ b/webapp/models/database.js @@ -19,6 +19,7 @@ var User = sequelize.define("user", { var Mod = sequelize.define("mod", { basename: Sequelize.STRING(100), + type: Sequelize.ENUM("mod", "game", "texturepack"), title: Sequelize.STRING(100), description: Sequelize.STRING(900), @@ -41,6 +42,7 @@ const CMod = require("./../../common/mod") function convertRowToMod(row) { var mod = new CMod(row.user.username) mod.basename = row.basename + mod.type = row.type mod.title = row.title mod.description = row.description mod.forum_id = row.forum_id @@ -80,6 +82,7 @@ async.parallel([ }, defaults: { user: user, + type: "mod", title: "Awards", description: "Adds awards to minetest",