<commit_before>'use strict';

var Subcategory = require('mongoose').model('Subcategory');

module.exports = {
    getTopics: function(req, res) {
        Subcategory.findOne({
            name: req.params.subcategory,
            category: req.params.category})
            .exec(function (err, subcategory) {
                if (err) {
                    console.log("Error retrieving subcategory...");
                }

                res.render('partials/forum/subcategory', {subcategory: subcategory});
            });
    }
    /*getForumMainData: function (req, res) {
        Category
            .find({})
            .exec(function (err, categories) {
                if (err) {
                    console.log('Error while getting categories forum data: ' + err);
                    return;
                }

                Subcategory
                    .find({})
                    .exec(function (err, subcategories) {
                        if (err) {
                            console.log('Error while getting subcategories forum data: ' + err);
                            return;
                        }

                        Comment
                            .find({})
                            .exec(function (err, comments) {
                                if (err) {
                                    console.log('Error while getting comments forum data: ' + err);
                                    return;
                                }

                                var viewModelResult = viewModels
                                    .ForumHomeViewModel
                                    .getForumHomeViewModel(categories, subcategories, comments);

                                res.render('partials/forum/forum-home', {result: viewModelResult});
                            });
                    });
            });
    }*/
};<commit_msg>Update subcategoryController.js<commit_after>'use strict';

var Subcategory = require('mongoose').model('Subcategory');

module.exports = {
    getTopics: function(req, res) {
        Subcategory.findOne({
            name: req.params.subcategory,
            category: req.params.category})
            .exec(function (err, subcategory) {
                if (err) {
                    console.log("Error retrieving subcategory...");
                }

                res.render('partials/forum/subcategory', {subcategory: subcategory});
            });
    }
};
{'fraction_non_alphanumeric': 0.10588235294117647, 'fraction_numerical': 0.0, 'mean_word_length': 1.1332179930795847, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6949878', 'n_tokens_mistral': 582, 'n_tokens_neox': 542, 'n_words': 110}