update: remove dollor from wallet and unit
This commit is contained in:
@@ -56,9 +56,9 @@ module.exports.getAllForUser = async (req, res) => {
|
||||
|
||||
let sort = {}
|
||||
|
||||
if (req.query?.deviceId_dollarProfit) {
|
||||
sort.dollarProfit = parseInt(req.query.deviceId_dollarProfit)
|
||||
}
|
||||
// if (req.query?.deviceId_dollarProfit) {
|
||||
// sort.dollarProfit = parseInt(req.query.deviceId_dollarProfit)
|
||||
// }
|
||||
if (req.query?.status) {
|
||||
sort.status = parseInt(req.query.status)
|
||||
}
|
||||
@@ -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 dollarBalance score')
|
||||
const user = await User.findById(installedDevice.userId).select('walletBalance score')
|
||||
const device = await Device.findById(installedDevice.deviceId)
|
||||
switch (req.params.type) {
|
||||
case 'accept': {
|
||||
@@ -145,7 +145,7 @@ module.exports.updateInstalled = [
|
||||
device.status = 1
|
||||
|
||||
user.walletBalance += device.profit
|
||||
user.dollarBalance += device.dollarProfit
|
||||
// user.dollarBalance += device.dollarProfit
|
||||
user.score += device.score
|
||||
|
||||
await Score.create({
|
||||
|
||||
Reference in New Issue
Block a user