<commit_before>var Call = require('../../system/call/index.js');

var UUID_Reg = /^[0-9A-Fa-f]+$/;

module.exports = {
    weld: function (ctx) {
        var uuid = ctx.req.param.uuid;
        ctx.errorTry(!uuid.match(UUID_Reg), Error); // 'weld.notuid'
        ctx.param.set(ctx.current.module.getMid(), "uuid", uuid);
    },
    addFollowing:function(ctx) {
        var module = ctx.current.module;
        var object = ctx.req.body.getValue("object");
        var target = ctx.req.body.getValue("target");

        Call.post(ctx, "/" + object + "/following/", {weld:module, data:{value:target}}, function(obj) {
        });
        Call.post(ctx, "/" + target + "/follower/", {weld:module, data:{value:object}}, function(obj) {
        });
        ctx.res.send({state:'OK'});
    },
    boxlist:function(ctx) {
        var saram = ctx.getSaram();
        var object = ctx.req.param.uuid;
        ctx.errorTry(!object.match(UUID_Reg), Error); // 'notuuid'

        Call.get(ctx, "/" + object + "/follower/", {weld:ctx.current.module, query:{}}, function(obj) {
            ctx.errorTry(obj.error, Error);

            var list = [];
            for(var i in obj.items) {
                list.push(obj.items[i].value);
            }
            list.push(object);
            ctx.res.send({target:list});
        });
    }
}<commit_msg>Social 모듈 Box List 버그 수정<commit_after>var Call = require('../../system/call/index.js');

var UUID_Reg = /^[0-9A-Fa-f]+$/;

module.exports = {
    weld: function (ctx) {
        var uuid = ctx.req.param.uuid;
        ctx.errorTry(!uuid.match(UUID_Reg), Error); // 'weld.notuid'
        ctx.param.set(ctx.current.module.getMid(), "uuid", uuid);
    },
    addFollowing:function(ctx) {
        var module = ctx.current.module;
        var object = ctx.req.body.getValue("object");
        var target = ctx.req.body.getValue("target");

        Call.post(ctx, "/" + object + "/following/", {weld:module, data:{value:target}}, function(obj) {
        });
        Call.post(ctx, "/" + target + "/follower/", {weld:module, data:{value:object}}, function(obj) {
        });
        ctx.res.send({state:'OK'});
    },
    boxlist:function(ctx) {
        ctx.current.autoNext = false;
        
        var saram = ctx.getSaram();
        var object = ctx.req.param.uuid;
        ctx.errorTry(!object.match(UUID_Reg), Error); // 'notuuid'

        Call.get(ctx, "/" + object + "/follower/", {weld:ctx.current.module, query:{}}, function(obj) {
            ctx.errorTry(obj.error, Error);

            var list = [];
            for(var i in obj.items) {
                list.push(obj.items[i].value);
            }
            list.push(object);
            ctx.res.send({target:list});
        });
    }
}
{'fraction_non_alphanumeric': 0.1910688140556369, 'fraction_numerical': 0.0014641288433382138, 'mean_word_length': 2.1486175115207375, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4408004', 'n_tokens_mistral': 922, 'n_tokens_neox': 904, 'n_words': 145}