Files: 1502f0ba17e8680d8ec32ad7bf6195d105d75f6a / poll / async / publishChooseOne.js
332 bytesRaw
1 | const ChooseOne = require('../sync/buildChooseOne') |
2 | const { isPoll, getPollErrors } = require('ssb-poll-schema') |
3 | |
4 | module.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