Endpoint for getting wine schema.
This is for manual registration of prelottery wines from the admin page.
This commit is contained in:
		| @@ -70,11 +70,22 @@ const deleteWines = () => { | ||||
|   return PreLotteryWine.deleteMany(); | ||||
| }; | ||||
|  | ||||
| const wineSchema = () => { | ||||
|   let schema = { ...PreLotteryWine.schema.obj }; | ||||
|   let nulledSchema = Object.keys(schema).reduce((accumulator, current) => { | ||||
|     accumulator[current] = ""; | ||||
|     return accumulator; | ||||
|   }, {}); | ||||
|  | ||||
|   return Promise.resolve(nulledSchema); | ||||
| }; | ||||
|  | ||||
| module.exports = { | ||||
|   allWines, | ||||
|   addWines, | ||||
|   wineById, | ||||
|   updateWineById, | ||||
|   deleteWineById, | ||||
|   deleteWines | ||||
|   deleteWines, | ||||
|   wineSchema | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user