dgdgproto/app/controllers/AdminController.js
2020-03-29 18:45:51 +02:00

18 lines
339 B
JavaScript

class AdminController {
constructor(database) {
this.database = database;
};
getAll(onSuccess, onError) {
let collection = this.database.collection('publicStates');
let cursor = collection.find({}, {}).toArray();
cursor.then((items) => {
onSuccess(items);
});
};
};
module.exports = AdminController;