Skip to content

Commit

Permalink
finished guild api route rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragon1320 committed Sep 4, 2018
1 parent e2a04c9 commit 4826139
Show file tree
Hide file tree
Showing 6 changed files with 449 additions and 83 deletions.
92 changes: 57 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"jimp": "^0.2.28",
"jsonwebtoken": "^8.3.0",
"moment-timezone": "^0.5.21",
"mongoose": "^5.1.6",
"mongoose": "^5.2.13",
"morgan": "^1.9.0",
"showdown": "^1.8.6"
}
Expand Down
3 changes: 2 additions & 1 deletion src/db/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

const GuildSchema = require("./schemas/guild");
const { GuildSchema, GuildScriptSchema } = require("./schemas/guild");
const LogSchema = require("./schemas/log");
const ScriptSchema = require("./schemas/script");
const SessionSchema = require("./schemas/session");
Expand All @@ -9,6 +9,7 @@ const UserSchema = require("./schemas/user");
module.exports = {

GuildSchema,
GuildScriptSchema,
LogSchema,
ScriptSchema,
SessionSchema,
Expand Down
3 changes: 2 additions & 1 deletion src/db/schemas/guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ const GuildSchema = new Schema({
scripts: [ guildScriptSchema ],
});

module.exports = mongoose.model("Guild", GuildSchema);
module.exports.GuildSchema = mongoose.model("Guild", GuildSchema);
module.exports.GuildScriptSchema = mongoose.model("GuildScript", guildScriptSchema);
2 changes: 1 addition & 1 deletion src/db/schemas/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const ScriptSchema = new Schema({
author_id: { type: Schema.Types.ObjectId, required: true },

// User set parameters. Note that 'thumbnail' should be set to a url of an image.
name: { type: String, requried: true },
name: { type: String, required: true },
description: { type: String, default: "" },
thumbnail: { type: String, default: getRandomThumbnail },
marketplace_enabled: { type: Boolean, default: false },
Expand Down

0 comments on commit 4826139

Please sign in to comment.