Commit c9b6e524fc9ae9c6dec40739d562b8bfd84fbc3d
Adds error types.
Piet Geursen committed on 3/7/2018, 1:42:53 AMParent: 9a7dcbbecaa7b3bc1c20a195d878ffdb9f6348c0
Files changed
types.js | changed |
types.js | ||
---|---|---|
@@ -1,7 +1,10 @@ | ||
1 | 1 | module.exports = { |
2 | 2 | chooseOnePollType: 'chooseOnePoll', |
3 | - chooseOnePositionType: 'chooseOnePosition' | |
3 | + chooseOnePositionType: 'chooseOnePosition', | |
4 | + ERROR_POSITION_TYPE: 'ERROR_POSITION_TYPE', | |
5 | + ERROR_POSITION_LATE: 'ERROR_POSITION_LATE', | |
6 | + ERROR_POSTITION_CHOICE: 'ERROR_POSTITION_CHOICE' | |
4 | 7 | } |
5 | 8 | |
6 | 9 | // Question: do these need to be different, could we just have 'chooseOne', |
7 | 10 | // because we already have: |
@@ -17,8 +20,8 @@ | ||
17 | 20 | // I wonder if a position could just be ... but this would mean we would have to have the parent poll, and then based o nthe type there, run a isOneChoicePostion validator... which I wthink could be good? Maybe I don't understandthe complexity of the other types of positions. |
18 | 21 | // { type: 'position', poll, choice } |
19 | 22 | // |
20 | 23 | // |
21 | -// I not that there's also a validation thing where | |
24 | +// I not that there's also a validation thing where | |
22 | 25 | // { type: 'position', poll, choice: 9000 } |
23 | 26 | // |
24 | 27 | // is probably invalid, and that the choice should be an integer bound by the parent poll choices. Can probably think about that case later, but making out reducer we're gonna have to put some filtering logic somewhere. Could programatically generate a position schema based on a poll.... _WOAH there EASY MIX_ |
Built with git-ssb-web