Files: ea9a423663b274022b27c3a9574fc2dfefa5b165 / poll / async / chooseOne.js
406 bytesRaw
1 | const ChooseOne = require('../sync/chooseOne') |
2 | const { isPoll } = require('ssb-poll-schema') |
3 | |
4 | module.exports = function (server) { |
5 | return function publishChooseOne (opts, cb) { |
6 | const poll = ChooseOne(opts) |
7 | console.log('poll', poll) |
8 | console.log('isChooseOnePoll', require('../../isPoll')) |
9 | if (!isPoll.chooseOne(poll)) return cb(isPoll.chooseOne.errors) |
10 | |
11 | server.publish(poll, cb) |
12 | } |
13 | } |
14 |
Built with git-ssb-web