<commit_before># modules
Team = require '../models/team'


# CONTROLLER
# ----------
module.exports = (app) ->

    # GET /api/teams
    app.get '/api/teams/', 'teams.list', (req, res) ->
        list = []
        Team.findAll().then (teams) ->
            list.push formatTeam(team) for team in teams
            res.json list

    # GET /api/teams/:id
    app.get '/api/teams/:id', 'teams.get', (req, res) ->
        res.findOrFail Team, req.params.id, (team) ->
            res.json formatTeam(team)

    # POST /api/teams
    app.post '/api/teams/', 'teams.post', (req, res) ->
        res.buildModelOrFail Team, req.body, (team) ->
            res.json formatTeam(team)


# METHODS
# -------

formatTeam = (team) ->
    result = team
    return result<commit_msg>N'envoi plus les mots de passe des teams<commit_after># modules
Team = require '../models/team'


# CONTROLLER
# ----------
module.exports = (app) ->

    # GET /api/teams
    app.get '/api/teams/', 'teams.list', (req, res) ->
        list = []
        Team.findAll().then (teams) ->
            list.push formatTeam(team) for team in teams
            res.json list

    # GET /api/teams/:id
    app.get '/api/teams/:id', 'teams.get', (req, res) ->
        res.findOrFail Team, req.params.id, (team) ->
            res.json formatTeam(team)

    # POST /api/teams
    app.post '/api/teams/', 'teams.post', (req, res) ->
        res.buildModelOrFail Team, req.body, (team) ->
            res.json formatTeam(team)


# METHODS
# -------

formatTeam = (team) ->
    result = team
    delete result.dataValues.password
    return result
{'fraction_non_alphanumeric': 0.17926296064959402, 'fraction_numerical': 0.0, 'mean_word_length': 1.9448529411764706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '3692401', 'n_tokens_mistral': 565, 'n_tokens_neox': 546, 'n_words': 126}