Built motion from commit 9ab4571.|0.0.110
[motion.git] / server / api / zendesk_configuration / zendesk_configuration.controller.js
index 04c2a16..c619678 100644 (file)
@@ -1,129 +1 @@
-'use strict';
-
-var _ = require('lodash');
-var ZendeskConfiguration = require('../../models').ZendeskConfiguration;
-var ZendeskText = require('../../models').ZendeskText;
-
-// Get list of zendesk_configurations
-exports.index = function(req, res) {
-  ZendeskConfiguration
-    .findAll({
-      where: req.query
-    })
-    .then(function(zendesk_configurations) {
-      return res.status(200).send(zendesk_configurations);
-    })
-    .catch(function(err) {
-      return handleError(res, err);
-    });
-};
-
-// Get a single zendesk_configuration
-exports.show = function(req, res) {
-  ZendeskConfiguration
-    .find({
-      where: {
-        id: req.params.id
-      },
-      include: [{
-        model: ZendeskText,
-        as: 'Subject'
-      }]
-    })
-    .then(function(zendesk_configuration) {
-      if (!zendesk_configuration) {
-        return res.sendStatus(404);
-      }
-      return res.send(zendesk_configuration);
-    })
-    .catch(function(err) {
-      return handleError(res, err);
-    });
-};
-
-// Creates a new zendesk_configuration in the DB.
-exports.create = function(req, res) {
-  ZendeskConfiguration
-    .create(req.body)
-    .then(function(zendesk_configuration) {
-      return res.status(201).send(zendesk_configuration);
-    })
-    .catch(function(err) {
-      return handleError(res, err);
-    });
-};
-
-// Updates an existing zendesk_configuration in the DB.
-exports.update = function(req, res) {
-  if (req.body.id) {
-    delete req.body.id;
-  }
-  ZendeskConfiguration
-    .findById(req.params.id)
-    .then(function(zendesk_configuration) {
-      if (!zendesk_configuration) {
-        return res.sendStatus(404);
-      }
-      var updated = _.merge(zendesk_configuration, req.body);
-      updated.save()
-        .then(function() {
-          return res.status(200).send(zendesk_configuration);
-        })
-        .catch(function(err) {
-          return handleError(res, err);
-        });
-    })
-    .catch(function(err) {
-      return handleError(res, err);
-    });
-};
-
-// Deletes a zendesk_configuration from the DB.
-exports.destroy = function(req, res) {
-  ZendeskConfiguration
-    .findById(req.params.id)
-    .then(function(zendesk_configuration) {
-      if (!zendesk_configuration) {
-        return res.sendStatus(404);
-      }
-      zendesk_configuration.destroy()
-        .then(function() {
-          return res.sendStatus(204);
-        })
-        .catch(function(err) {
-          return handleError(res, err);
-        });
-    })
-    .catch(function(err) {
-      return handleError(res, err);
-    });
-};
-
-exports.addSubject = function(req, res, next) {
-  // console.log(req.params);
-  ZendeskConfiguration
-    .findById(req.params.id)
-    .then(function(configuration) {
-      if (!configuration) {
-        return res.sendStatus(500);
-      }
-      ZendeskText
-        .create(req.body)
-        .then(function(text) {
-          configuration.addSubject(text);
-          return res.status(200).send(text);
-        })
-        .catch(function(err) {
-          return handleError(res, err);
-          // return next(err);
-        });
-    })
-    .catch(function(err) {
-      // return next(err);
-      return handleError(res, err);
-    });
-};
-
-function handleError(res, err) {
-  return res.status(500).send(err);
-}
+var _0xa45f=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x5A\x65\x6E\x64\x65\x73\x6B\x43\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x5A\x65\x6E\x64\x65\x73\x6B\x46\x69\x65\x6C\x64","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6C\x6C","\x73\x68\x6F\x77","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64","\x63\x72\x65\x61\x74\x65","\x62\x6F\x64\x79","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x66\x69\x6E\x64\x42\x79\x49\x64","\x64\x65\x73\x74\x72\x6F\x79","\x61\x64\x64\x43\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E\x46\x69\x65\x6C\x64","\x61\x64\x64\x53\x75\x62\x6A\x65\x63\x74","\x73\x75\x62\x6A\x65\x63\x74","\x61\x64\x64\x44\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x61\x64\x64\x46\x69\x65\x6C\x64","\x66\x69\x65\x6C\x64","\x74\x79\x70\x65","\x61\x64\x64\x43\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E\x54\x61\x67\x73","\x65\x72\x72\x6F\x72","\x73\x65\x74\x54\x61\x67\x73","\x65\x6E\x64"];_0xa45f[0];var _=require(_0xa45f[1]);var ZendeskConfiguration=require(_0xa45f[3])[_0xa45f[2]];var ZendeskField=require(_0xa45f[3])[_0xa45f[4]];exports[_0xa45f[5]]=function(_0x32ebx4,_0x32ebx5){ZendeskConfiguration[_0xa45f[11]]({where:_0x32ebx4[_0xa45f[10]]})[_0xa45f[9]](function(_0x32ebx7){return _0x32ebx5[_0xa45f[8]](200)[_0xa45f[7]](_0x32ebx7)})[_0xa45f[6]](function(_0x32ebx6){return handleError(_0x32ebx5,_0x32ebx6)})};exports[_0xa45f[12]]=function(_0x32ebx4,_0x32ebx5){ZendeskConfiguration[_0xa45f[16]]({where:{id:_0x32ebx4[_0xa45f[15]][_0xa45f[14]]},include:[{all:true}]})[_0xa45f[9]](function(_0x32ebx8){if(!_0x32ebx8){return _0x32ebx5[_0xa45f[13]](404)};return _0x32ebx5[_0xa45f[7]](_0x32ebx8)})[_0xa45f[6]](function(_0x32ebx6){return handleError(_0x32ebx5,_0x32ebx6)})};exports[_0xa45f[17]]=function(_0x32ebx4,_0x32ebx5){ZendeskConfiguration[_0xa45f[17]](_0x32ebx4[_0xa45f[18]])[_0xa45f[9]](function(_0x32ebx8){return _0x32ebx5[_0xa45f[8]](201)[_0xa45f[7]](_0x32ebx8)})[_0xa45f[6]](function(_0x32ebx6){return handleError(_0x32ebx5,_0x32ebx6)})};exports[_0xa45f[19]]=function(_0x32ebx4,_0x32ebx5){if(_0x32ebx4[_0xa45f[18]][_0xa45f[14]]){delete _0x32ebx4[_0xa45f[18]][_0xa45f[14]]};ZendeskConfiguration[_0xa45f[22]](_0x32ebx4[_0xa45f[15]][_0xa45f[14]])[_0xa45f[9]](function(_0x32ebx8){if(!_0x32ebx8){return _0x32ebx5[_0xa45f[13]](404)};var _0x32ebx9=_[_0xa45f[20]](_0x32ebx8,_0x32ebx4[_0xa45f[18]]);_0x32ebx9[_0xa45f[21]]()[_0xa45f[9]](function(){return _0x32ebx5[_0xa45f[8]](200)[_0xa45f[7]](_0x32ebx8)})[_0xa45f[6]](function(_0x32ebx6){return handleError(_0x32ebx5,_0x32ebx6)})})[_0xa45f[6]](function(_0x32ebx6){return handleError(_0x32ebx5,_0x32ebx6)})};exports[_0xa45f[23]]=function(_0x32ebx4,_0x32ebx5){ZendeskConfiguration[_0xa45f[22]](_0x32ebx4[_0xa45f[15]][_0xa45f[14]])[_0xa45f[9]](function(_0x32ebx8){if(!_0x32ebx8){return _0x32ebx5[_0xa45f[13]](404)};_0x32ebx8[_0xa45f[23]]()[_0xa45f[9]](function(){return _0x32ebx5[_0xa45f[13]](204)})[_0xa45f[6]](function(_0x32ebx6){return handleError(_0x32ebx5,_0x32ebx6)})})[_0xa45f[6]](function(_0x32ebx6){return handleError(_0x32ebx5,_0x32ebx6)})};exports[_0xa45f[24]]=function(_0x32ebx4,_0x32ebx5,_0x32ebxa){ZendeskConfiguration[_0xa45f[22]](_0x32ebx4[_0xa45f[15]][_0xa45f[14]])[_0xa45f[9]](function(_0x32ebxb){if(!_0x32ebxb){return _0x32ebx5[_0xa45f[13]](500)};ZendeskField[_0xa45f[17]](_0x32ebx4[_0xa45f[18]])[_0xa45f[9]](function(_0x32ebxc){switch(_0x32ebx4[_0xa45f[15]][_0xa45f[31]]){case _0xa45f[26]:_0x32ebxb[_0xa45f[25]](_0x32ebxc)[_0xa45f[9]](function(){return _0x32ebx5[_0xa45f[8]](200)[_0xa45f[7]](_0x32ebxc)})[_0xa45f[6]](function(_0x32ebx6){return handleError(_0x32ebx5,_0x32ebx6)});break;case _0xa45f[28]:_0x32ebxb[_0xa45f[27]](_0x32ebxc)[_0xa45f[9]](function(){return _0x32ebx5[_0xa45f[8]](200)[_0xa45f[7]](_0x32ebxc)})[_0xa45f[6]](function(_0x32ebx6){return handleError(_0x32ebx5,_0x32ebx6)});break;case _0xa45f[30]:_0x32ebxb[_0xa45f[29]](_0x32ebxc)[_0xa45f[9]](function(){return _0x32ebx5[_0xa45f[8]](200)[_0xa45f[7]](_0x32ebxc)})[_0xa45f[6]](function(_0x32ebx6){return handleError(_0x32ebx5,_0x32ebx6)});break}})[_0xa45f[6]](function(_0x32ebx6){return handleError(_0x32ebx5,_0x32ebx6)})})[_0xa45f[6]](function(_0x32ebx6){return handleError(_0x32ebx5,_0x32ebx6)})};exports[_0xa45f[32]]=function(_0x32ebx4,_0x32ebx5,_0x32ebxa){ZendeskConfiguration[_0xa45f[22]](_0x32ebx4[_0xa45f[15]][_0xa45f[14]])[_0xa45f[9]](handleEntityNotFound(_0x32ebx5))[_0xa45f[9]](function(_0x32ebxb){return _0x32ebxb[_0xa45f[34]](_0x32ebx4[_0xa45f[18]])})[_0xa45f[9]](function(_0x32ebxd){return _0x32ebx5[_0xa45f[13]](200)})[_0xa45f[6]](function(_0x32ebx6){console[_0xa45f[33]](_0x32ebx6);return handleError(_0x32ebx5,_0x32ebx6)})};function handleEntityNotFound(_0x32ebx5){return function(_0x32ebxf){if(!_0x32ebxf){_0x32ebx5[_0xa45f[8]](404)[_0xa45f[35]]();return null};return _0x32ebxf}}function handleError(_0x32ebx5,_0x32ebx6){return _0x32ebx5[_0xa45f[8]](500)[_0xa45f[7]](_0x32ebx6)}
\ No newline at end of file