Skip to content

Commit bef6dba

Browse files
Merge pull request #2207 from OneCommunityGlobal/Diya_Fix_BackendToMain3.05
Diya 🔥 fix(sonarqube): Fixed Sonarqube Duplication Issues
2 parents 8a200e7 + e772669 commit bef6dba

4 files changed

Lines changed: 362 additions & 549 deletions

File tree

src/controllers/bmdashboard/bmEquipmentController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ const bmEquipmentController = (BuildingEquipment) => {
298298
}
299299

300300
if (!mongoose.Types.ObjectId.isValid(createdBy)) {
301-
console.error('Invalid createdBy ID:', createdBy);
301+
console.error('Invalid createdBy ID');
302302
return res.status(400).send({
303303
error: 'Invalid user ID format. Please log in again.',
304304
details: `Expected a valid MongoDB ObjectId, got: ${createdBy}`,

src/controllers/calendarController.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const calendarController = function (CalendarEvent, ProcessingProject) {
77
return res.status(400).send({ error: 'Month and year query parameters are required.' });
88
}
99

10-
const monthNum = parseInt(month, 10);
11-
const yearNum = parseInt(year, 10);
10+
const monthNum = Number.parseInt(month, 10);
11+
const yearNum = Number.parseInt(year, 10);
1212

1313
if (Number.isNaN(monthNum) || Number.isNaN(yearNum) || monthNum < 1 || monthNum > 12) {
1414
return res.status(400).send({ error: 'Invalid month or year value.' });

src/controllers/lbdashboard/bidsController.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ const bidsController = function (Bids) {
8080

8181
const paypalCheckoutNowLink = ordDetails?.links.find((u) => u.href.includes('checkoutnow'));
8282
const newBidsData = {
83-
...req.body,
83+
listingId: req.body.listingId,
84+
termsAgreed: req.body.termsAgreed,
85+
email: req.body.email,
86+
startDate: req.body.startDate,
87+
endDate: req.body.endDate,
88+
biddingHistory: req.body.biddingHistory,
89+
phone: req.body.phone,
8490
userId: userExists._id,
8591
paypalOrderId: ordDetails?.id,
8692
paypalCheckoutNowLink: paypalCheckoutNowLink?.href,

0 commit comments

Comments
 (0)