/log/schema endpoint for getting prelottery schema template.
This commit is contained in:
		| @@ -48,11 +48,16 @@ router.route("/log/wines").post(mustBeAuthenticated, async (req, res) => { | |||||||
|   res.send(true); |   res.send(true); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| router.route("/log").post(async (req, res) => { | router.route("/log/schema").get(mustBeAuthenticated, async (req, res) => { | ||||||
|   if (!req.isAuthenticated()) { |   let schema = {...PreLotteryWine.schema.obj}; | ||||||
|     res.send(false); |   let nulledSchema = Object.keys(schema).reduce( | ||||||
|     return; |     (accumulator, current) => { | ||||||
|   } |       accumulator[current] = ""; | ||||||
|  |       return accumulator | ||||||
|  |     }, {}); | ||||||
|  |  | ||||||
|  |   res.send(nulledSchema) | ||||||
|  | }) | ||||||
|  |  | ||||||
| router.route("/log").post(mustBeAuthenticated, async (req, res) => { | router.route("/log").post(mustBeAuthenticated, async (req, res) => { | ||||||
|   await PreLotteryWine.deleteMany(); |   await PreLotteryWine.deleteMany(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user