You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
used with (e.g. hapi application, another framework, standalone, ...): standalone
any other relevant information: none
How can we help?
I want to retrieve the rule name which trigger my external validation, this helper is not available with any.external. I need it like of any.custom() with helpers.state.path[0]
Joi.object({//...email: Joi.string().external(uniqueRecord)})constuniqueRecord=async(value: any,helpers: any): Promise<any>=>{//const field = "here the value will be email"const tenant =helpers.prefs.context.tenant;constcollection=helpers.prefs.context.collection;constquery=awaitdb.query(tenant,collection)constisUnique=awaitquery.find({[field]: value}).count()===0if(!isUnique){console.warn('uniqueRecord : not unique');returnhelpers.error('any.invalid')}else{console.log('uniqueRecord : unique');returnundefined}}
I tried to use description like on doc, but I can't retrieve it on my external function.
Thanks,
The text was updated successfully, but these errors were encountered:
Context
How can we help?
I want to retrieve the rule name which trigger my external validation, this helper is not available with any.external. I need it like of any.custom() with
helpers.state.path[0]
I tried to use
description
like on doc, but I can't retrieve it on my external function.Thanks,
The text was updated successfully, but these errors were encountered: