Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
revert changes to js
  • Loading branch information
Harshit28j authored and lazyperson1020 committed Mar 25, 2025
commit 291732995a359bb40f6725ca3fe86aff4c4625b1
20 changes: 9 additions & 11 deletions frontend/src/js/controllers/challengeListCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,7 @@
vm.noneCurrentChallenge = false;
vm.noneUpcomingChallenge = false;
vm.nonePastChallenge = false;
vm.getAllResults = function(parameters, resultsArray, typ,status){
if (status === 'current') {
parameters.url = 'challenges/challenge/present/approved/public';
} else if (status === 'upcoming') {
parameters.url = 'challenges/challenge/future/approved/public';
} else if (status === 'past') {
parameters.url = 'challenges/challenge/past/approved/public';
}
vm.getAllResults = function(parameters, resultsArray, typ){
parameters.method = 'GET';
parameters.callback = {
onSuccess: function(response) {
Expand Down Expand Up @@ -95,11 +88,16 @@
}

// calls for ongoing challenges
vm.getAllResults(parameters, vm.currentList, "noneCurrentChallenge", 'current');
parameters.url = 'challenges/challenge/present/approved/public';
vm.getAllResults(parameters, vm.currentList, "noneCurrentChallenge");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this line.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

// calls for upcoming challenges
vm.getAllResults(parameters, vm.upcomingList, "noneUpcomingChallenge", 'upcoming');
parameters.url = 'challenges/challenge/future/approved/public';
vm.getAllResults(parameters, vm.upcomingList, "noneUpcomingChallenge");

// calls for past challenges
vm.getAllResults(parameters, vm.pastList, "nonePastChallenge", 'past');
parameters.url = 'challenges/challenge/past/approved/public';
vm.getAllResults(parameters, vm.pastList, "nonePastChallenge");

vm.scrollUp = function() {
angular.element($window).bind('scroll', function() {
Expand Down