Skip to content

Commit

Permalink
Merge pull request #100 from Prometheus7-creator/main
Browse files Browse the repository at this point in the history
sequenceNumber changed to sequenceNo
  • Loading branch information
abhinovpankaj authored Dec 9, 2023
2 parents 8500ca9 + 6cc6f21 commit 5a06c93
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions routes/location-endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ router.route('/add')
try{
var errResponse;
// Get user input
const { name, description, createdBy,url,parentid,parenttype,type,isInvasive, sequenceNumber} = req.body;
const { name, description, createdBy,url,parentid,parenttype,type,isInvasive, sequenceNo} = req.body;

// Validate user input
if (!(name&&parentid)) {
Expand All @@ -40,7 +40,7 @@ try{
"lasteditedBy":createdBy,
"editedat":creationtime,
"isInvasive":isInvasive,
"sequenceNumber": sequenceNumber
"sequenceNo": sequenceNo
}
}catch(ex){
console.log(ex);
Expand Down
4 changes: 2 additions & 2 deletions routes/subproject-endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ router.route('/add')
try{
var errResponse;
// Get user input
const { name, description, parentid,parenttype,isInvasive,url,assignedTo,createdBy, sequenceNumber } = req.body;
const { name, description, parentid,parenttype,isInvasive,url,assignedTo,createdBy, sequenceNo } = req.body;

// Validate user input
if (!(name&&parentid)) {
Expand Down Expand Up @@ -67,7 +67,7 @@ try{
"lasteditedby":createdBy,
"children":[],
"isInvasive": isInvasive,
"sequenceNumber": sequenceNumber
"sequenceNo": sequenceNo
}
}catch(ex){
console.log(ex);
Expand Down
10 changes: 5 additions & 5 deletions service/projectmetadata/getProjectMetaData.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async function getSubProjectsData(projectId) {
subProjectData._id = subProject._id;
subProjectData.name = subProject.name;
subProjectData.isInvasive = subProject.isInvasive?subProject.isInvasive:false;
subProjectData.sequenceNumber = subProject.sequenceNumber;
subProjectData.sequenceNo = subProject.sequenceNo;
const subProjectLocations = [];
const subProjectChildren = await location.getLocationByParentId(subProject._id);

Expand All @@ -108,22 +108,22 @@ async function getSubProjectsData(projectId) {
const locId = loc._id;
const locName = loc.name;
const locType = loc.type;
const sequenceNumber = loc.sequenceNumber;
const sequenceNo = loc.sequenceNo;
const isInvasive = loc.isInvasive?loc.isInvasive:false;
subProjectLocations.push({ locationId: locId, sequenceNumber:sequenceNumber, locationName: locName,
subProjectLocations.push({ locationId: locId, sequenceNo:sequenceNo, locationName: locName,
locationType: locType,isInvasive:isInvasive });
}
}
subProjectData.subProjectLocations = subProjectLocations
.sort(function(subProj1,subProj2){
return (subProj1.sequenceNumber-subProj2.sequenceNumber)
return (subProj1.sequenceNo-subProj2.sequenceNo)
});
subProjects.push(subProjectData);

}
}
subProjects.sort(function(subProj1,subProj2){
return (subProj1.sequenceNumber-subProj2.sequenceNumber)
return (subProj1.sequenceNo-subProj2.sequenceNo)
});
return subProjects;
}
Expand Down
4 changes: 2 additions & 2 deletions service/reportstrategy/reportGeneration.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ class ReportGeneration{
}
}
subProjects.sort(function(subProj1,subProj2){
return (subProj1.sequenceNumber-subProj2.sequenceNumber);
return (subProj1.sequenceNo-subProj2.sequenceNo);
});
locations.sort(function(loc1,loc2){
return (loc1.sequenceNumber-loc2.sequenceNumber);
return (loc1.sequenceNo-loc2.sequenceNo);
});
orderedProjects.push(...subProjects);
orderedProjects.push(...locations);
Expand Down
4 changes: 2 additions & 2 deletions service/subprojectreportgeneration.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ const reordersubProjectLocations = function(locations){
}
}
subProjectApartments.sort(function(apt1,apt2){
return (apt1.sequenceNumber-apt2.sequenceNumber);
return (apt1.sequenceNo-apt2.sequenceNo);
});
subProjectLocations.sort(function(loc1,loc2){
return (loc1.sequenceNumber-loc2.sequenceNumber)});
return (loc1.sequenceNo-loc2.sequenceNo)});
orderedlocationsInSubProjects.push(...subProjectApartments);
orderedlocationsInSubProjects.push(...subProjectLocations);
return orderedlocationsInSubProjects;
Expand Down
6 changes: 3 additions & 3 deletions service/updateParentHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const addLocationMetadataInParent = async (locationId, location) => {
url: location.url,
description: location.description,
isInvasive: location.isInvasive ? location.isInvasive : false,
sequenceNumber: location.sequenceNumber !== undefined ? location.sequenceNumber : null,
sequenceNo: location.sequenceNo !== undefined ? location.sequenceNo : null,
};

if (location.parenttype == "subproject") {
Expand Down Expand Up @@ -68,7 +68,7 @@ const addSectionMetadataInParent = async (sectionId, section) => {
visualsignsofleak: section.visualsignsofleak,
isuploading: false,
count: section.images.length,
sequenceNumber: section.sequenceNumber !== undefined ? section.sequenceNumber : null,
sequenceNo: section.sequenceNo !== undefined ? section.sequenceNo : null,
};

if (section.parenttype == "project") {
Expand Down Expand Up @@ -116,7 +116,7 @@ const addSubprojectMetaDataInProject = async (subProjectId, subProject) => {
url: subProject.url,
description: subProject.description,
isInvasive: subProject.isInvasive,
sequenceNumber: subProject.sequenceNumber !== undefined ? subProject.sequenceNumber : null,
sequenceNo: subProject.sequenceNo !== undefined ? subProject.sequenceNo : null,
};
await ProjectDAO.addProjectChild(
subProject.parentid,
Expand Down

0 comments on commit 5a06c93

Please sign in to comment.