Skip to content

Commit

Permalink
fix(core): removed required check
Browse files Browse the repository at this point in the history
  • Loading branch information
EFF committed Sep 20, 2019
1 parent 5c94efc commit a80c464
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/bp/core/routers/admin/languages.ts
Expand Up @@ -40,21 +40,20 @@ export class LanguagesRouter extends CustomRouter {
const { additionalLanguages } = await this.configProvider.getBotpressConfig()
const { error } = Joi.validate(
additionalLanguages,
Joi.array()
.items(
Joi.object({
name: Joi.string().required(),
code: Joi.string().required()
})
)
.required()
Joi.array().items(
Joi.object({
name: Joi.string().required(),
code: Joi.string().required()
})
)
)

if (error) {
this.logger.warn('Additional langages are not valid')
return []
}

return additionalLanguages!
return additionalLanguages || []
}

setupRoutes() {
Expand Down

0 comments on commit a80c464

Please sign in to comment.