Updating valid to optionals.
This commit is contained in:
parent
2ba2e2e3e6
commit
5d387870d2
|
@ -25,9 +25,9 @@ function smtpValidation() {
|
|||
function settingValidation() {
|
||||
// prettier-ignore
|
||||
return Joi.object({
|
||||
platformUrl: Joi.string().valid("", null),
|
||||
logoUrl: Joi.string().valid("", null),
|
||||
docsUrl: Joi.string().valid("", null),
|
||||
platformUrl: Joi.string().optional(),
|
||||
logoUrl: Joi.string().optional(),
|
||||
docsUrl: Joi.string().optional(),
|
||||
company: Joi.string().required(),
|
||||
}).unknown(true)
|
||||
}
|
||||
|
@ -44,9 +44,9 @@ function googleValidation() {
|
|||
function buildConfigSaveValidation() {
|
||||
// prettier-ignore
|
||||
return joiValidator.body(Joi.object({
|
||||
_id: Joi.string(),
|
||||
_rev: Joi.string(),
|
||||
group: Joi.string(),
|
||||
_id: Joi.string().optional(),
|
||||
_rev: Joi.string().optional(),
|
||||
group: Joi.string().optional(),
|
||||
type: Joi.string().valid(...Object.values(Configs)).required(),
|
||||
config: Joi.alternatives()
|
||||
.conditional("type", {
|
||||
|
|
Loading…
Reference in New Issue