mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
Added tags to clients page
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
|
||||
var mongoose = require('mongoose'),
|
||||
Client = mongoose.model('Client'),
|
||||
Workorder = mongoose.model('Workorder');
|
||||
Workorder = mongoose.model('Workorder'),
|
||||
Tag = mongoose.model('Tag');
|
||||
|
||||
var frequencies = ["annual","semi","quarterly","sterilizer","tg","ert","rae","medgas","imaging","neptune","anesthesia"];
|
||||
|
||||
@ -58,6 +59,18 @@ exports.workorders = function(req, res, next) {
|
||||
});
|
||||
};
|
||||
|
||||
exports.tags = function(req, res, next) {
|
||||
var id = req.param('client_id');
|
||||
|
||||
Tag.find({ client: id })
|
||||
.exec(function(err, tags) {
|
||||
if (err) return next(err);
|
||||
if (!tags) return next(new Error('Failed to load tags ' + id));
|
||||
|
||||
res.json(tags);
|
||||
});
|
||||
};
|
||||
|
||||
exports.create = function(req, res, next) {
|
||||
console.log(req.body);
|
||||
|
||||
|
@ -104,7 +104,7 @@ html(lang="en", ng-app="tags", ng-controller="tags.PageCtrl")
|
||||
.control-group
|
||||
label.control-label Device Warranty Expiration
|
||||
.controls
|
||||
input.text(type='date', ng-model='deviceWarrantyExpiration')
|
||||
input.text(type='date', ng-model='tag.deviceWarrantyExpiration')
|
||||
|
||||
.control-group
|
||||
label.control-label Test
|
||||
|
Reference in New Issue
Block a user