<commit_before>module.exports.injectControllerTo = (mod) => {
    mod.controller('SurveysListCtrl', [
        'Surveys',
        '$state',
        '$mdDialog',
        function (Surveys, $state, $mdDialog) {

            this.initialize = () => {
                this.loadSurveys();
            };

            this.loadSurveys = () => {
                Surveys.getInstances()
                    .then((surveys) => {
                        this.surveys = surveys;
                    })
                    .catch((error) => {

                    });
            };

            this.editSurvey = (question) => {
                $state.go('base.app.admin.surveys.edit', {
                    questionId: '123'
                });
            };

            this.deleteSurvey = (survey) => {
                var deleteDialog = $mdDialog.confirm()
                    .title('Desea eliminar la siguiente encuesta?')
                    .targetEvent(event)
                    .ok('SI')
                    .cancel('NO');

                $mdDialog.show(deleteDialog)
                    .then(() => {
                        Surveys.deleteInstance({
                            surveyId: survey.id
                        })
                        .then((response) => {
                            this.loadSurveys();
                        })
                        .catch(() => {

                        });
                    });
            };

            this.surveys = [];
            this.columns = [
                {
                    key: 'nombre',
                    label: 'Nombre'
                },
                {
                    key: 'fecha_hora_creacion',
                    label: 'Hora de creacion'
                }
            ];
            this.actions = [
                /*
                {
                    label: 'Editar',
                    onCall: this.editSurvey
                },
                */
                {
                    label: 'Eliminar',
                    onCall: this.deleteSurvey
                }
            ];
        }
    ]);
};<commit_msg>[<NAME>] - Editar Encuestas<commit_after>module.exports.injectControllerTo = (mod) => {
    mod.controller('SurveysListCtrl', [
        'Surveys',
        '$state',
        '$mdDialog',
        function (Surveys, $state, $mdDialog) {

            this.initialize = () => {
                this.loadSurveys();
            };

            this.loadSurveys = () => {
                Surveys.getInstances()
                    .then((surveys) => {
                        this.surveys = surveys;
                    })
                    .catch((error) => {

                    });
            };

            this.editSurvey = (survey) => {
                $state.go('base.app.admin.surveys.edit', {
                    surveyId: survey.id
                });
            };

            this.deleteSurvey = (survey) => {
                var deleteDialog = $mdDialog.confirm()
                    .title('Desea eliminar la siguiente encuesta?')
                    .targetEvent(event)
                    .ok('SI')
                    .cancel('NO');

                $mdDialog.show(deleteDialog)
                    .then(() => {
                        Surveys.deleteInstance({
                            surveyId: survey.id
                        })
                        .then((response) => {
                            this.loadSurveys();
                        })
                        .catch(() => {

                        });
                    });
            };

            this.surveys = [];
            this.columns = [
                {
                    key: 'nombre',
                    label: 'Nombre'
                },
                {
                    key: 'fecha_hora_creacion',
                    label: 'Hora de creacion'
                }
            ];
            this.actions = [
                {
                    label: 'Editar',
                    onCall: this.editSurvey
                },
                {
                    label: 'Eliminar',
                    onCall: this.deleteSurvey
                }
            ];
        }
    ]);
};
{'fraction_non_alphanumeric': 0.11706161137440758, 'fraction_numerical': 0.0007109004739336493, 'mean_word_length': 0.7285012285012284, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 24, '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': '981613', 'n_tokens_mistral': 1074, 'n_tokens_neox': 975, 'n_words': 132}