2020-03-29 16:21:36 +00:00
|
|
|
|
|
|
|
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:21:36 +00:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2020-03-29 16:45:51 +00:00
|
|
|
module.exports = AdminController;
|