git ssb

0+

Piet / ssb-loomio



Tree: 1502f0ba17e8680d8ec32ad7bf6195d105d75f6a

Files: 1502f0ba17e8680d8ec32ad7bf6195d105d75f6a / 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