git ssb

0+

Piet / ssb-loomio



Tree: 153b2ae34195193ff8c51e32d55de4ba79ea73b5

Files: 153b2ae34195193ff8c51e32d55de4ba79ea73b5 / 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