Various tweaks

This commit is contained in:
Dobie Wollert
2015-10-14 02:51:05 -07:00
parent 68b2c8114b
commit 0e5db1c9ee
9 changed files with 48 additions and 9 deletions

View File

@ -104,6 +104,20 @@ function devicesControllerFactory(isEdit) {
});
}
function destroy() {
$scope.model.deleted = true;
Devices.update({id: $scope.model._id}, $scope.model, function() {
$location.path("/clients/" + $scope.model.client);
});
}
function restore() {
$scope.model.deleted = false;
Devices.update({id: $scope.model._id}, $scope.model, function() {
$location.path("/clients/" + $scope.model.client);
});
}
var hashids = new Hashids("biomed");
var search = $location.search();
@ -121,6 +135,8 @@ function devicesControllerFactory(isEdit) {
$scope.create = create;
$scope.update = update;
$scope.destroy = destroy;
$scope.restore = restore;
deviceTypePickerFactory('category', 'Device Type');
deviceTypePickerFactory('make', 'Make');