Much virtual many lotteries #12

Merged
kasperrt merged 7 commits from feat/online-lottery into master 2020-03-16 08:24:28 +00:00
2 changed files with 6 additions and 1 deletions
Showing only changes of commit 35e736a9d9 - Show all commits

View File

@@ -21,11 +21,13 @@ router.use((req, res, next) => {
router.route("/winners").delete(mustBeAuthenticated, async (req, res) => {
await VirtualWinner.deleteMany();
io.emit("refresh_data", {});
res.json(true);
});
router.route("/attendees").delete(mustBeAuthenticated, async (req, res) => {
await Attendee.deleteMany();
io.emit("refresh_data", {});
res.json(true);
});

View File

@@ -99,7 +99,10 @@ export default {
this.currentWinnerDrawn = false;
}, 15000);
});
this.socket.on("refresh_data", async msg => {
this.getAttendees();
this.getWinners();
});
this.socket.on("new_attendee", async msg => {
this.getAttendees();
});