git ssb

0+

Piet / ssb-loomio



Tree: 5f55ad219f72d734cb27efc4d543d507f1fd04ae

Files: 5f55ad219f72d734cb27efc4d543d507f1fd04ae / poll / async / publishChooseOne.js

332 bytesRaw
1const ChooseOne = require('../sync/buildChooseOne')
2const { isPoll, getPollErrors } = require('ssb-poll-schema')
3
4module.exports = function (server) {
5 return function publishChooseOne (opts, cb) {
6 const poll = ChooseOne(opts)
7 if (!isPoll.chooseOne(poll)) return cb(getPollErrors(poll))
8
9 server.publish(poll, cb)
10 }
11}
12

Built with git-ssb-web