Skip to content

Commit 8665ac7

Browse files
committed
Updated sudo to system
1 parent e3807c9 commit 8665ac7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/controllers/v4/internal/rewards.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const getRewards = async (req, res) => {
2020
}
2121

2222
// Fetch only the rewards field
23-
const system = await System.findById('sudo').select('rewards');
23+
const system = await System.findById('system').select('rewards');
2424

2525
if (!system || !Array.isArray(system.rewards)) {
2626
return res.status(404).json({ message: 'No rewards found' });
@@ -69,7 +69,7 @@ export const createReward = async (req, res) => {
6969
return res.status(400).json({ message: 'Missing required reward fields' });
7070
}
7171

72-
const system = await System.findById('sudo');
72+
const system = await System.findById('system');
7373
if (!system) {
7474
return res.status(404).json({ message: 'System not found' });
7575
}
@@ -125,7 +125,7 @@ export const redeemReward = async (req, res) => {
125125
}
126126

127127
// Find the system document (assuming you have only one system doc)
128-
const system = await System.findById('sudo').select('rewards');
128+
const system = await System.findById('system').select('rewards');
129129
if (!system) {
130130
return res.status(500).json({ message: 'System configuration not found for rewards' });
131131
}

0 commit comments

Comments
 (0)