git ssb

0+

Piet / ssb-loomio



Commit 3c9734dbc87863e2373fcdfa511441b061e7a813

Makes types a bit more specific

Piet Geursen committed on 3/5/2018, 12:46:46 AM
Parent: 18f9223076dfa1bbba1b0c3dcc24fa951ea62e93

Files changed

poll/schema/details/chooseOne.jschanged
position/schema/details/chooseOne.jschanged
types.jschanged
poll/schema/details/chooseOne.jsView
@@ -1,6 +1,6 @@
1-const { chooseOneType } = require('../../../types')
2-const typeStringPattern = `^${chooseOneType}$`
1+const { chooseOnePollType } = require('../../../types')
2+const typeStringPattern = `^${chooseOnePollType}$`
33
44 var schema = {
55 type: 'object',
66 required: ['type', 'choices'],
position/schema/details/chooseOne.jsView
@@ -1,8 +1,8 @@
11 const Validate = require('is-my-json-valid')
22
3-const typeString = 'chooseOne'
4-const typeStringPattern = `^${typeString}$`
3+const { chooseOnePositionType } = require('../../../types')
4+const typeStringPattern = `^${chooseOnePositionType}$`
55 const typeStringRegex = new RegExp(typeStringPattern)
66
77 function isValidTypeString (string) {
88 return typeStringRegex.test(string)
@@ -10,9 +10,9 @@
1010
1111 function create ({choice, reason}) {
1212 return {
1313 choice,
14- type: typeString,
14+ type: chooseOnePositionType,
1515 reason
1616 }
1717 }
1818
types.jsView
@@ -1,3 +1,4 @@
11 module.exports = {
2- chooseOneType: 'chooseOne',
2+ chooseOnePollType: 'chooseOnePoll',
3+ chooseOnePositionType: 'chooseOnePosition'
34 }

Built with git-ssb-web