1
0
mirror of synced 2024-11-12 01:10:47 +01:00

fix ghost stamp bug

This commit is contained in:
ghkkk090 2022-09-10 10:47:53 +07:00
parent 0a64596ae1
commit 814f1882d8
2 changed files with 25 additions and 4 deletions

View File

@ -110,10 +110,29 @@ export default class GhostModule extends Module {
}
}
// Get all of the friend cars for the carId provided
// Get all of the challenger car for the carId provided except beated car
let checkBeatedCar = await prisma.carStampTarget.findMany({
where: {
stampTargetCarId: body.carId,
recommended: false
},
orderBy:{
carId: 'asc'
}
});
let arrChallengerCarId = [];
for(let i=0; i<checkBeatedCar.length; i++)
{
arrChallengerCarId.push(checkBeatedCar[i].carId);
}
let challengers = await prisma.carChallenger.findMany({
where: {
carId: body.carId
carId: body.carId,
NOT: {
challengerCarId: { in: arrChallengerCarId }, // Except beated challenger id
},
}
});

View File

@ -990,7 +990,8 @@ export default class TerminalModule extends Module {
// Unlock all of the stamp targets for the car
await prisma.carStampTarget.updateMany({
where: {
stampTargetCarId: body.carId
stampTargetCarId: body.carId,
recommended: true
},
data: {
locked: false
@ -1007,7 +1008,8 @@ export default class TerminalModule extends Module {
await prisma.carStampTarget.updateMany({
where: {
carId: targetCar,
stampTargetCarId: body.carId
stampTargetCarId: body.carId,
recommended: true
},
data: {
locked: true