Skip to content

Commit

Permalink
fixed admin side get request bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunalpal216 committed Feb 1, 2024
1 parent 44c8a57 commit 32c4961
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/gcScoreboard/spardhaController.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ exports.getSpardhaOverallStandings = async (req,res) => {
exports.getSpardhaEventStandings = async (req,res) => {
try{
let eventsGcStandings = await spardhaOverallStandingsModel.find();
if(await checkIfAdmin(req.body.email,"spardha")){
if(req.query.forAdmin==="true" && await checkIfAdmin(req.body.email,"spardha")){
eventsGcStandings = eventsGcStandings.filter((eventStanding) => eventStanding["posterEmail"]===req.body.email);
}
res.json({"success" : true,"details" : eventsGcStandings});
Expand Down

0 comments on commit 32c4961

Please sign in to comment.