-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from Unitie-FAC/deleteprompt
- Loading branch information
Showing
11 changed files
with
208 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var redisClient = require('redis-connection')(); | ||
redisClient.set('hello', 'world'); | ||
redisClient.get('hello', function (err, reply) { | ||
console.log('hello', reply.toString()); // hello world | ||
redisClient.quit(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var bluebird = require('bluebird'); | ||
var redisClient = require('redis'); | ||
bluebird.promisifyAll(redisClient.RedisClient.prototype); | ||
bluebird.promisifyAll(redisClient.Multi.prototype); | ||
|
||
module.exports = redisClient.createClient(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// var bluebird = require('bluebird'); | ||
// var client = require('redis-connection')(); | ||
// var redisClient = require('redis'); | ||
// var client = redisClient.createClient(); | ||
|
||
var client = require('./redis.js'); | ||
// bluebird.promisifyAll(redisClient.RedisClient.prototype); | ||
// bluebird.promisifyAll(redisClient.Multi.prototype); | ||
|
||
exports.register = function (server, options, next) { | ||
|
||
server.route([ | ||
{ | ||
method: 'POST', | ||
path: '/societydashboardsearch', | ||
config: { | ||
description: 'return home page', | ||
handler: function(request,reply){ | ||
var requestPayload = request.payload; | ||
var arrayOfFilters = []; | ||
var requestPayloadKeys = Object.keys(requestPayload); | ||
|
||
var arrayOfSetNames = function(requestPayload,requestPayloadKeys){ | ||
requestPayloadKeys.forEach(function(elem){ | ||
if(requestPayload[elem] !== '' && requestPayload[elem] !== null && requestPayload[elem] !== undefined && elem.length !== 0){ | ||
var setName = elem+ ':' + requestPayload[elem]; | ||
arrayOfFilters.push(setName); | ||
} | ||
}); | ||
}; | ||
|
||
arrayOfSetNames(requestPayload,requestPayloadKeys); | ||
client.sinterAsync.apply(client, arrayOfFilters) | ||
.then(function(filteredlist){ | ||
console.log(filteredlist); | ||
}); | ||
return reply('You have searched'); | ||
|
||
|
||
} | ||
} | ||
} | ||
|
||
]); | ||
|
||
return next(); | ||
}; | ||
|
||
exports.register.attributes = { | ||
name: 'Societydashboardsearch' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters