diff --git a/src/models/communities.js b/src/models/communities.js index 31023c9..166ed05 100644 --- a/src/models/communities.js +++ b/src/models/communities.js @@ -15,10 +15,13 @@ const CommunitySchema = new Schema({ }, icon: String, title_ids: { - type: [Number], + type: [String], + default: undefined + }, + title_id: { + type: [String], default: undefined }, - title_id: String, community_id: String, is_recommended: { type: Number, diff --git a/src/services/miiverse-api/routes/communities.js b/src/services/miiverse-api/routes/communities.js index 3c3e6a2..fb323e8 100644 --- a/src/services/miiverse-api/routes/communities.js +++ b/src/services/miiverse-api/routes/communities.js @@ -10,9 +10,12 @@ router.get('/0/posts', function (req, res) { /* Parse out parameters from URL and headers */ const paramPack = processHeaders.data.decodeParamPack(req.headers["x-nintendo-parampack"]); //"[0:1]=1407375153523200" + console.log(paramPack.title_id); let community = await database.getCommunityByTitleID(paramPack.title_id); + console.log(community.title_id); /* Go to the database for posts. */ let posts = await database.getPostsByCommunity(community, parseInt(req.query.limit)); + console.log(posts); /* Build formatted response and send it off. */ let response = await comPostGen.PostsResponse(posts, community);