Last active
May 23, 2018 11:30
-
-
Save hugomd/7467538c54a041cd3d336bf28a02c144 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
availableRooms.forEach((room, index) => { | |
console.log(`${index} - ${room.name}`) | |
}) | |
+ const roomSchema = [ | |
+ { | |
+ description: 'Select a room', | |
+ name: 'room', | |
+ conform: v => { | |
+ if (v >= availableRooms.length) { | |
+ return false | |
+ } | |
+ return true | |
+ }, | |
+ message: 'Room must only be numbers', | |
+ required: true | |
+ } | |
+ ] | |
+ const { room: chosenRoom } = await get(roomSchema) | |
+ const room = availableRooms[chosenRoom] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment