18 lines
339 B
JavaScript
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;
|