Refactor/everything #11

Merged
KevinMidboe merged 21 commits from refactor/everything into master 2020-03-10 09:23:31 +00:00
Showing only changes of commit a4960c41b1 - Show all commits

View File

@@ -48,11 +48,16 @@ router.route("/log/wines").post(mustBeAuthenticated, async (req, res) => {
res.send(true);
});
router.route("/log").post(async (req, res) => {
if (!req.isAuthenticated()) {
res.send(false);
return;
}
router.route("/log/schema").get(mustBeAuthenticated, async (req, res) => {
let schema = {...PreLotteryWine.schema.obj};
let nulledSchema = Object.keys(schema).reduce(
(accumulator, current) => {
accumulator[current] = "";
return accumulator
}, {});
res.send(nulledSchema)
})
router.route("/log").post(mustBeAuthenticated, async (req, res) => {
await PreLotteryWine.deleteMany();