updateeeeeeeeeee

This commit is contained in:
mahyargdz
2024-12-31 15:10:46 +03:30
parent c7251f7c27
commit 27e27a9eb7
5 changed files with 154 additions and 169 deletions
+2 -1
View File
@@ -136,7 +136,7 @@ module.exports.updateInstalled = [
if (!installedDevice) {
throw res.status(404).json({ msg: 'این ایدی وجود ندارد' })
} else {
const user = await User.findById(installedDevice.userId).select('walletBalance score')
const user = await User.findById(installedDevice.userId).select('walletBalance score totalScore')
const device = await Device.findById(installedDevice.deviceId)
switch (req.params.type) {
case 'accept': {
@@ -146,6 +146,7 @@ module.exports.updateInstalled = [
user.walletBalance += device.profit
// user.dollarBalance += device.dollarProfit
user.totalScore += device.score
user.score += device.score
await Score.create({