Sha256: c9ce60545ab6773b9c41624f675f7043882095e40f612198c04619f6e52ccb83

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

var rcHelpers = require('rhoconnect_helpers');

var JsSample = function() {

  this.query = function(resp){
    var result = {'1': {'name': 'iPhone'}};
    resp.send(result);
  };

  this.create = function(resp){
    resp.send('2');
  };

  this.update = function(resp){
    resp.send('');
  };

  this.del = function(resp){
    resp.send('');
  };

  this.login = function(resp){
    var result = "success";
    resp.send(result);
  };

  this.logoff = function(resp){
    resp.send(true);
  };

  this.getUser = function(resp){
    rcHelpers.current_user(resp,function(resp){
      var current_user = resp['result']["login"];
      resp.send(current_user);
    });
  };

  this.getSource = function(resp){
    rcHelpers.source(resp,function(resp){
      var source = resp['result']['id'];
      resp.send(source);
    });
  };

// var get_stash_result = function(resp){
//  resp.params = {"1":{"name":"John"}};
//  rc_helpers.stash_result(resp,function(resp){
//    var result = {};
//    resp.send(result);
//  })
// }

};

module.exports = new JsSample();

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rhoconnect-4.0.0.beta.10 spec/apps/rhotestapp/models/js/js_sample.js