mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
stuff
This commit is contained in:
@ -8,7 +8,7 @@ var frequencies = ["annual","semi","quarterly","sterilizer","tg","ert","rae","me
|
||||
|
||||
exports.index = function(req, res) {
|
||||
var query = Client.find({ deleted: false })
|
||||
.select('name identifier')
|
||||
.select('name identifier address')
|
||||
.slice('contacts', 1)
|
||||
.sort('name')
|
||||
.exec(function(err, results) {
|
||||
@ -79,6 +79,7 @@ exports.create = function(req, res, next) {
|
||||
identifier: req.body.identifier,
|
||||
contacts: req.body.contacts,
|
||||
address: req.body.address,
|
||||
notes: req.body.notes,
|
||||
frequencies: {}
|
||||
});
|
||||
|
||||
@ -108,6 +109,7 @@ exports.update = function(req, res, next) {
|
||||
client.contacts = req.body.contacts;
|
||||
client.address = req.body.address;
|
||||
client.frequencies = req.body.frequencies;
|
||||
client.notes = req.body.notes;
|
||||
|
||||
return client.save(function(err) {
|
||||
if (!err) {
|
||||
|
@ -134,6 +134,8 @@ module.exports = function(calendar) {
|
||||
cmd.$inc[key] = 1;
|
||||
console.log(cmd);
|
||||
Client.findByIdAndUpdate(req.body.client, cmd, function(err, ignored) { callback(err, result) });
|
||||
} else {
|
||||
callback(null, result);
|
||||
}
|
||||
},
|
||||
],
|
||||
|
@ -20,7 +20,11 @@ var clientSchema = new Schema({
|
||||
frequencies: {},
|
||||
pms: {},
|
||||
workorders: [{ type: ObjectId, ref: 'Workorder' }],
|
||||
deleted: { type: Boolean, default: false }
|
||||
deleted: { type: Boolean, default: false },
|
||||
notes: {
|
||||
internal: String,
|
||||
tech: String
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = mongoose.model('Client', clientSchema);
|
||||
|
Reference in New Issue
Block a user