Fixed MAPBOX_KEY validation error

pull/72/head
Alex Tran 2022-03-19 10:42:32 +07:00
parent f790315d3f
commit dbd79f4797
1 changed files with 3 additions and 3 deletions

@ -13,9 +13,9 @@ export const immichAppConfig: ConfigModuleOptions = {
JWT_SECRET: Joi.string().required(),
ENABLE_MAPBOX: Joi.boolean().required().valid(true, false),
MAPBOX_KEY: Joi.any().when('ENABLE_MAPBOX', {
is: true,
then: Joi.string().required(),
otherwise: Joi.string().optional(),
is: false,
then: Joi.string().optional().allow(null, ''),
otherwise: Joi.string().required(),
}),
}),
};