mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Merge pull request #31723 from overleaf/ar-do-not-queue-invalid-analytics-messages
[analytics] do not queue invalid analytics messages GitOrigin-RevId: 9182fe41974ab618e7a51330bfba6703894295f4
This commit is contained in:
@@ -49,6 +49,9 @@ function validateSchema(schema, data) {
|
|||||||
if (isZodErrorLike(err)) {
|
if (isZodErrorLike(err)) {
|
||||||
const errorMessages = err.issues.map(issue => {
|
const errorMessages = err.issues.map(issue => {
|
||||||
const value = getPathValue(data, issue.path)
|
const value = getPathValue(data, issue.path)
|
||||||
|
if (issue.path.length === 0) {
|
||||||
|
return issue.message
|
||||||
|
}
|
||||||
const fieldName = String(issue.path[issue.path.length - 1])
|
const fieldName = String(issue.path[issue.path.length - 1])
|
||||||
if (isRequiredError(issue, value)) {
|
if (isRequiredError(issue, value)) {
|
||||||
return `"${fieldName}" is required`
|
return `"${fieldName}" is required`
|
||||||
|
|||||||
Reference in New Issue
Block a user