Built motion from commit 05106a3.|0.0.33
[motion.git] / server / api / report_tree / report_tree.controller.js
index a6b11b0..484b9b5 100644 (file)
@@ -1,46 +1 @@
-'use strict';
-
-var _ = require('lodash');
-var util = require('util');
-var ReportTree = require('../../models').ReportTree;
-
-// Get the reports trees
-exports.index = function(req, res) {
-  ReportTree
-    .findAll()
-    .then(function(trees) {
-      if (!trees) {
-        return res.sendStatus(404);
-      }
-      return res.status(200).send(trees);
-    })
-    .catch(function(err) {
-      return handleError(res, err);
-    });
-};
-
-// Updates an existing report in the DB.
-exports.update = function(req, res) {
-  ReportTree
-    .findById(req.params.id)
-    .then(function(tree) {
-      if (!tree) {
-        return res.sendStatus(404);
-      }
-      var updated = _.merge(tree, req.body);
-      updated.save()
-        .then(function() {
-          return res.status(200).send(tree);
-        })
-        .catch(function(err) {
-          return handleError(res, err);
-        });
-    })
-    .catch(function(err) {
-      return handleError(res, err);
-    });
-};
-
-function handleError(res, err) {
-  return res.status(500).send(err);
-}
+var _0xd130=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x52\x65\x70\x6F\x72\x74\x54\x72\x65\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x66\x69\x6E\x64\x41\x6C\x6C","\x75\x70\x64\x61\x74\x65","\x62\x6F\x64\x79","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64"];_0xd130[0];var _=require(_0xd130[1]);var util=require(_0xd130[2]);var ReportTree=require(_0xd130[4])[_0xd130[3]];exports[_0xd130[5]]=function(_0xbbebx4,_0xbbebx5){ReportTree[_0xd130[11]]()[_0xd130[10]](function(_0xbbebx7){if(!_0xbbebx7){return _0xbbebx5[_0xd130[7]](404)};return _0xbbebx5[_0xd130[9]](200)[_0xd130[8]](_0xbbebx7);})[_0xd130[6]](function(_0xbbebx6){return handleError(_0xbbebx5,_0xbbebx6)})};exports[_0xd130[12]]=function(_0xbbebx4,_0xbbebx5){ReportTree[_0xd130[18]](_0xbbebx4[_0xd130[17]][_0xd130[16]])[_0xd130[10]](function(_0xbbebx8){if(!_0xbbebx8){return _0xbbebx5[_0xd130[7]](404)};var _0xbbebx9=_[_0xd130[14]](_0xbbebx8,_0xbbebx4[_0xd130[13]]);_0xbbebx9[_0xd130[15]]()[_0xd130[10]](function(){return _0xbbebx5[_0xd130[9]](200)[_0xd130[8]](_0xbbebx8)})[_0xd130[6]](function(_0xbbebx6){return handleError(_0xbbebx5,_0xbbebx6)});})[_0xd130[6]](function(_0xbbebx6){return handleError(_0xbbebx5,_0xbbebx6)})};function handleError(_0xbbebx5,_0xbbebx6){return _0xbbebx5[_0xd130[9]](500)[_0xd130[8]](_0xbbebx6)}
\ No newline at end of file