From 9bc11e2f6c524de983c67484bdcf42f2fdab15f1 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sat, 19 Feb 2022 06:18:41 +0300 Subject: [PATCH] Update channels.js --- scripts/db/schemes/channels.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/db/schemes/channels.js b/scripts/db/schemes/channels.js index 6b723cdd..33d7cab5 100644 --- a/scripts/db/schemes/channels.js +++ b/scripts/db/schemes/channels.js @@ -18,11 +18,15 @@ module.exports = { .regex(/^[\sa-zA-Z\u00C0-\u00FF0-9'-]+$/) .allow(null), broadcast_area: Joi.array().items( - Joi.string().regex(/^(s\/[A-Z]{2}-[A-Z0-9]{1,3}|c\/[A-Z]{2}|r\/[A-Z0-9]{3,7})$/) + Joi.string() + .regex(/^(s\/[A-Z]{2}-[A-Z0-9]{1,3}|c\/[A-Z]{2}|r\/[A-Z0-9]{3,7})$/) + .required() + ), + languages: Joi.array().items( + Joi.string() + .regex(/^[a-z]{3}$/) + .required() ), - languages: Joi.array() - .items(Joi.string().regex(/^[a-z]{3}$/)) - .allow(''), categories: Joi.array().items(Joi.string().regex(/^[a-z]+$/)), is_nsfw: Joi.boolean().strict().required(), logo: Joi.string().uri().allow(null)