Add update-event for winners/attendees
This commit is contained in:
@@ -21,11 +21,13 @@ router.use((req, res, next) => {
|
|||||||
|
|
||||||
router.route("/winners").delete(mustBeAuthenticated, async (req, res) => {
|
router.route("/winners").delete(mustBeAuthenticated, async (req, res) => {
|
||||||
await VirtualWinner.deleteMany();
|
await VirtualWinner.deleteMany();
|
||||||
|
io.emit("refresh_data", {});
|
||||||
res.json(true);
|
res.json(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
router.route("/attendees").delete(mustBeAuthenticated, async (req, res) => {
|
router.route("/attendees").delete(mustBeAuthenticated, async (req, res) => {
|
||||||
await Attendee.deleteMany();
|
await Attendee.deleteMany();
|
||||||
|
io.emit("refresh_data", {});
|
||||||
res.json(true);
|
res.json(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -99,7 +99,10 @@ export default {
|
|||||||
this.currentWinnerDrawn = false;
|
this.currentWinnerDrawn = false;
|
||||||
}, 15000);
|
}, 15000);
|
||||||
});
|
});
|
||||||
|
this.socket.on("refresh_data", async msg => {
|
||||||
|
this.getAttendees();
|
||||||
|
this.getWinners();
|
||||||
|
});
|
||||||
this.socket.on("new_attendee", async msg => {
|
this.socket.on("new_attendee", async msg => {
|
||||||
this.getAttendees();
|
this.getAttendees();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user