| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- 'use strict'
-
- const Joi = require('joi')
-
- const pluginConfig = {
- handlerType: 'profile',
- docs: {
- description: 'Returns previously scored profiles',
- notes: 'returns from the MatchQueue Table',
- },
- }
-
- const validators = {
- params: Joi.object({ profile_id: Joi.number() }),
- }
-
- module.exports = {
- method: 'GET',
- path: '/{profile_id}/queue',
- options: {
- ...pluginConfig.docs,
- tags: ['api'],
- /** Protect this route with authentication? */
- auth: false,
- handler: async function (request, h) {
- const { profile_id } = request.params
- const { matchQueueService } = request.server.services()
-
- return await matchQueueService.getPotentials(profile_id)
- },
- /** Validate based on validators object */
- validate: {
- ...validators,
- failAction: 'log',
- },
-
- // couldn't get validate server response working...
-
- /** Validate the server response */
- // response: {
- // schema: Joi.object({
- // ok: Joi.bool(),
- // handler: Joi.string(),
- // data: Joi.object(),
- // }),
- // },
- },
- }
|