Delete log db data on war delete
parent
ee6dc8bc5b
commit
278e130614
|
@ -176,8 +176,15 @@ wars.route('/:id')
|
||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete players having this war ID as foreign key
|
// delete linked appearances
|
||||||
PlayerModel.find({warId: item._id}).remove().exec();
|
PlayerModel.find({warId: item._id}).remove().exec();
|
||||||
|
LogKillModel.find({war: item._id}).remove().exec();
|
||||||
|
LogRespawnModel.find({war: item._id}).remove().exec();
|
||||||
|
LogReviveModel.find({war: item._id}).remove().exec();
|
||||||
|
LogFlagModel.find({war: item._id}).remove().exec();
|
||||||
|
LogBudgetModel.find({war: item._id}).remove().exec();
|
||||||
|
LogTransportModel.find({war: item._id}).remove().exec();
|
||||||
|
LogPointsModel.find({war: item._id}).remove().exec();
|
||||||
|
|
||||||
// check if logfiles exist and delete from fs
|
// check if logfiles exist and delete from fs
|
||||||
const warDir = __dirname + '/../resource/logs/' + req.params.id;
|
const warDir = __dirname + '/../resource/logs/' + req.params.id;
|
||||||
|
|
Loading…
Reference in New Issue