bugfix
This commit is contained in:
parent
2a39301713
commit
a938ade360
@ -44,7 +44,7 @@ export const parseValidationError = (error: MongoServerError) =>
|
|||||||
{
|
{
|
||||||
if (error.code !== 121 || !error.errInfo)
|
if (error.code !== 121 || !error.errInfo)
|
||||||
throw new Error('Not a validation error');
|
throw new Error('Not a validation error');
|
||||||
const rule = error.errInfo.details.schemaRulesNotSatisfied;
|
const [ rule ] = error.errInfo.details.schemaRulesNotSatisfied;
|
||||||
const missing = rule.missingProperties as string[];
|
const missing = rule.missingProperties as string[];
|
||||||
const required = rule.specifiedAs.required as string[];
|
const required = rule.specifiedAs.required as string[];
|
||||||
return { missing, required };
|
return { missing, required };
|
||||||
|
Loading…
Reference in New Issue
Block a user