mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-23 02:06:29 -05:00
MediaConfig: Fix Joi schema alternatives
'...use' tries to go up one level and grab the value of 'use' there and not the same level 'use' as we want here Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
1942df0da0
commit
5195955eb8
1 changed files with 3 additions and 3 deletions
|
@ -44,7 +44,7 @@ const mediaSchema = Joi.object({
|
||||||
otherwise: Joi.optional(),
|
otherwise: Joi.optional(),
|
||||||
}).label('HD_MEDIA_BACKEND_FILESYSTEM_UPLOAD_PATH'),
|
}).label('HD_MEDIA_BACKEND_FILESYSTEM_UPLOAD_PATH'),
|
||||||
},
|
},
|
||||||
s3: Joi.when('...use', {
|
s3: Joi.when('use', {
|
||||||
is: Joi.valid(BackendType.S3),
|
is: Joi.valid(BackendType.S3),
|
||||||
then: Joi.object({
|
then: Joi.object({
|
||||||
accessKey: Joi.string().label('HD_MEDIA_BACKEND_S3_ACCESS_KEY'),
|
accessKey: Joi.string().label('HD_MEDIA_BACKEND_S3_ACCESS_KEY'),
|
||||||
|
@ -55,7 +55,7 @@ const mediaSchema = Joi.object({
|
||||||
}),
|
}),
|
||||||
otherwise: Joi.optional(),
|
otherwise: Joi.optional(),
|
||||||
}),
|
}),
|
||||||
azure: Joi.when('...use', {
|
azure: Joi.when('use', {
|
||||||
is: Joi.valid(BackendType.AZURE),
|
is: Joi.valid(BackendType.AZURE),
|
||||||
then: Joi.object({
|
then: Joi.object({
|
||||||
connectionString: Joi.string().label(
|
connectionString: Joi.string().label(
|
||||||
|
@ -65,7 +65,7 @@ const mediaSchema = Joi.object({
|
||||||
}),
|
}),
|
||||||
otherwise: Joi.optional(),
|
otherwise: Joi.optional(),
|
||||||
}),
|
}),
|
||||||
imgur: Joi.when('...use', {
|
imgur: Joi.when('use', {
|
||||||
is: Joi.valid(BackendType.IMGUR),
|
is: Joi.valid(BackendType.IMGUR),
|
||||||
then: Joi.object({
|
then: Joi.object({
|
||||||
clientID: Joi.string().label('HD_MEDIA_BACKEND_IMGUR_CLIENT_ID'),
|
clientID: Joi.string().label('HD_MEDIA_BACKEND_IMGUR_CLIENT_ID'),
|
||||||
|
|
Loading…
Reference in a new issue