diff --git a/app/controllers/clients.js b/app/controllers/clients.js index 8f9e83b..fe4be09 100644 --- a/app/controllers/clients.js +++ b/app/controllers/clients.js @@ -179,10 +179,27 @@ exports.update = function(req, res, next) { return Client.findById(id, function(err, client) { client.name = req.body.name; client.identifier = req.body.identifier.toUpperCase(); - client.contacts = req.body.contacts; client.address = req.body.address; client.frequencies = req.body.frequencies; client.notes = req.body.notes; + + + // name phone email + + for (var i = 0; i < 2; i++) { + if (req.body.contacts[i]) { + client.contacts.set(i, {}); + client.contacts[i].name = req.body.contacts[i].name; + client.contacts[i].phone = req.body.contacts[i].phone; + client.contacts[i].email = req.body.contacts[i].email; + } else { + client.contacts[i] = null; + } + } + + client.markModified('contacts'); + + console.log(client); return client.save(function(err) { if (err) diff --git a/public/partials/clients/edit.html b/public/partials/clients/edit.html index df5f982..1aeebde 100644 --- a/public/partials/clients/edit.html +++ b/public/partials/clients/edit.html @@ -253,7 +253,7 @@ - {{workorder.reason}}
+ {{workorder.reason}}-- No Reason --
Techs: {{ workorder.techs | techs }}
{{workorder.remarks}} diff --git a/public/partials/schedule/pms.html b/public/partials/schedule/pms.html index e833f3e..9a01686 100644 --- a/public/partials/schedule/pms.html +++ b/public/partials/schedule/pms.html @@ -28,7 +28,7 @@ - + diff --git a/public/partials/schedule/report.html b/public/partials/schedule/report.html index f61eb9c..272c0d7 100644 --- a/public/partials/schedule/report.html +++ b/public/partials/schedule/report.html @@ -18,7 +18,7 @@ - + diff --git a/public/partials/workorders/edit.html b/public/partials/workorders/edit.html index 8f9be34..da894f1 100644 --- a/public/partials/workorders/edit.html +++ b/public/partials/workorders/edit.html @@ -15,7 +15,7 @@
Status
-
+
{{master.status}}