diff --git a/app/assets/v2/js/pages/dashboard-sponsors.js b/app/assets/v2/js/pages/dashboard-sponsors.js index a0029ad2bf2..56dffb0011a 100644 --- a/app/assets/v2/js/pages/dashboard-sponsors.js +++ b/app/assets/v2/js/pages/dashboard-sponsors.js @@ -13,7 +13,7 @@ window.open(url, 'Loading', 'top=0,left=0,width=400,height=600,status=no,toolbar=no,location=no,menubar=no,titlebar=no'); }, - markWinner: function($event, project, prizeIndex) { + markWinner: function($event, project) { let vm = this; const url = '/api/v0.1/hackathon_project/set_winner/'; const markWinner = fetchData(url, 'POST', { @@ -21,21 +21,6 @@ winner: $event ? 1 : 0 }, {'X-CSRFToken': vm.csrf}); - vm.prizes[prizeIndex].submissions.forEach((submission, submissionIndex) => { - if (submission.pk !== project.pk && submission.winner) { - console.log(submission.pk); - console.log(project.pk); - const unmarkPreviousWinner = fetchData(url, 'POST', { - project_id: submission.pk, - winner: 0 - }, {'X-CSRFToken': vm.csrf}); - - $.when(unmarkPreviousWinner).then(() => { - vm.$set(vm.prizes[prizeIndex].submissions[submissionIndex], 'winner', false); - }); - } - }); - $.when(markWinner).then(response => { if (response.message) { alert(response.message); diff --git a/app/assets/v2/js/vue-components.js b/app/assets/v2/js/vue-components.js index 7f79d17e5c8..58af341810d 100644 --- a/app/assets/v2/js/vue-components.js +++ b/app/assets/v2/js/vue-components.js @@ -617,23 +617,6 @@ Vue.component('project-card', { } }, methods: { - markWinner: function($event, project) { - let vm = this; - - const url = '/api/v0.1/hackathon_project/set_winner/'; - const markWinner = fetchData(url, 'POST', { - project_id: project.pk, - winner: $event ? 1 : 0 - }, {'X-CSRFToken': vm.csrf}); - - $.when(markWinner).then(response => { - if (response.message) { - alert(response.message); - } - }).catch(err => { - console.log(err); - }); - }, projectModal() { let project = this.$props.project; @@ -641,8 +624,7 @@ Vue.component('project-card', { } }, template: `
-
- mark winner +
grant_tag badge