added userstest endpoint to respond with an object with embedded array, this makes knockout binding easier for SPA.
This commit is contained in:
parent
f625396537
commit
7c8dd36605
@ -3,7 +3,7 @@ module.exports = function(){
|
|||||||
var faker = require("faker");
|
var faker = require("faker");
|
||||||
var _ = require("lodash");
|
var _ = require("lodash");
|
||||||
var directions = ["in", "out"];
|
var directions = ["in", "out"];
|
||||||
var users = _.times(maxUserCount, function (n)
|
var usersData = _.times(maxUserCount, function (n)
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
id: n,
|
id: n,
|
||||||
@ -24,12 +24,16 @@ module.exports = function(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
var userDataObject = {users: _.orderBy(usersData, ["lastName", "firstName"],["asc", "asc"])};
|
||||||
return {
|
return {
|
||||||
userSwipeData: _.orderBy(userSwipeDataPoints, ["id"], ["asc"]),
|
userSwipeData: _.orderBy(userSwipeDataPoints, ["id"], ["asc"]),
|
||||||
//users: _.orderBy(data, ["userId", "asc"]),
|
//users: _.orderBy(data, ["userId", "asc"]),
|
||||||
users: _.orderBy(users, ["lastName", "firstName"],["asc", "asc"]),
|
users: _.orderBy(usersData, ["lastName", "firstName"],["asc", "asc"]),
|
||||||
//weather: _.orderBy(data, ["timestamp"],["asc"]),
|
//weather: _.orderBy(data, ["timestamp"],["asc"]),
|
||||||
stats: _.countBy(userSwipeDataPoints, "userId")
|
stats: _.countBy(userSwipeDataPoints, "userId"),
|
||||||
|
userstest: {
|
||||||
|
users: _.orderBy(usersData, ["lastName", "firstName"],["asc", "asc"])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user