Skip to content

Commit

Permalink
Fixed Messages Endpoint
Browse files Browse the repository at this point in the history
* Minor Fix with MongoLab
  • Loading branch information
aneesh-neelam committed Feb 22, 2015
1 parent 27995f4 commit 27cedb3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ exports.get = function (app, data, callback) {
clientCollection.findOne({}, keys, asyncCallback);
},
message: function (asyncCallback) {
messageCollection.find({}, {limit: 10, sort: [['datefield', 'asc']]}).toArray(asyncCallback);
messageCollection.find({}, {limit: 10, sort: [['_id', 'desc']]}).toArray(asyncCallback);
}
};
var onFetch = function (err, results) {
Expand All @@ -55,11 +55,11 @@ exports.get = function (app, data, callback) {
console.log(data.status);
callback(true, data);
}
else if (results.client && results.messages) {
else if (results.client && results.message) {
data.android = results.client.android;
data.ios = results.client.ios;
data.windows = results.client.windows;
data.messages = results.messages;
data.messages = results.message;
data.status = status.codes.success;
callback(false, data);
}
Expand Down

0 comments on commit 27cedb3

Please sign in to comment.