'use strict'; const Joi = require('joi'); const pluginConfig = { handlerType: 'grouping', docs: { description: 'join', notes: 'Join a grouping by creating a membership record' } } const validators = { join: { payload: Joi.object() } } module.exports = { method: 'POST', path: '/join', options: { ...pluginConfig.docs, tags: ['api'], auth: false, handler: async function (request, h) { try { return { ok: true, handler: pluginConfig.handlerType, data: { foo: 'bar' } } } catch(err) { return { ok: false, handler: pluginConfig.handlerType, data: { error: `${err}` }, } } }, validate: validators.join, response: { schema: Joi.object({ ok: Joi.bool(), handler: Joi.string(), data: validators.join }), failAction: 'log' } } }