Skip to content

Commit

Permalink
fix for route
Browse files Browse the repository at this point in the history
  • Loading branch information
Prometheus7-creator committed Jul 14, 2024
1 parent d5b39eb commit c795f99
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion database/mongo.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var Connect = async function () {
module.exports.SubProjects = client.db(dbName).collection('SubProject');
module.exports.Locations = client.db(dbName).collection('Location');
module.exports.Sections = client.db(dbName).collection('VisualSection');
module.exports.DynamicSections = client.db(dbName).collection('DynamicSection');
module.exports.DynamicSections = client.db(dbName).collection('DynamicVisualSection');
module.exports.Users = client.db(dbName).collection('Users');
module.exports.ProjectDocuments = client.db(dbName).collection('ProjectDocuments');

Expand Down
2 changes: 1 addition & 1 deletion routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var projectRouter = require("./routes/project-endpoint");
var subprojectRouter = require("./routes/subproject-endpoint");
var locationRouter = require("./routes/location-endpoint");
var sectionRouter = require("./routes/section-endpoint");
var dynamicSectionRouter = require("./routes/dynamic-section-router");
var dynamicSectionRouter = require("./routes/dynamic-section-endpoint");
var invasivesectionRouter = require("./routes/invasivesection-endpoint");
var conclusiveSectionRouter = require("./routes/conclusivesection-endpoint");
var tenantRouter = require("./routes/tenants-endpoint");
Expand Down
5 changes: 2 additions & 3 deletions routes/dynamic-section-endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var errResponse;
// Get user input

const { name,additionalconsiderations,
additionalconsiderationshtml,furtherinvasivereviewrequired,images,createdby,parentid,parenttype,unitUnavailable } = req.body;
additionalconsiderationshtml,furtherinvasivereviewrequired,images,createdby,parentid,parenttype,unitUnavailable, companyIdentifier } = req.body;

// Validate user input
if (!(name&&parentid)) {
Expand All @@ -28,7 +28,6 @@ var creationtime= (new Date(Date.now())).toISOString();
var newSection = {
"additionalconsiderations":additionalconsiderations,
"additionalconsiderationshtml":additionalconsiderationshtml? additionalconsiderationshtml: "",
"conditionalassessment":conditionalassessment,
"createdat":creationtime,
"createdby":createdby,
"editedat":creationtime,
Expand All @@ -39,7 +38,7 @@ var newSection = {
"parenttype":parenttype,
"images":images,
"unitUnavailable": unitUnavailable,
"isuploading":false,
"companyIdentifier": companyIdentifier
}
var result = await DynamicSectionService.addSection(newSection);
if (result.reason) {
Expand Down

0 comments on commit c795f99

Please sign in to comment.