dgdgproto/app/controllers/AdminController.js

19 lines
339 B
JavaScript
Raw Normal View History

class AdminController {
constructor(database) {
this.database = database;
};
getAll(onSuccess, onError) {
let collection = this.database.collection('publicStates');
2020-03-29 16:45:51 +00:00
let cursor = collection.find({}, {}).toArray();
cursor.then((items) => {
onSuccess(items);
});
};
};
2020-03-29 16:45:51 +00:00
module.exports = AdminController;