perf: do not send minRows and maxRows undefined values to client (#10600)

This reduces the size of the initial HTML
This commit is contained in:
Alessio Gravili
2025-01-15 14:00:52 -07:00
committed by GitHub
parent 22f3c79dc0
commit 0a1cf7bc85

View File

@@ -120,14 +120,14 @@ export const sanitizeFields = async ({
console.warn( console.warn(
`(payload): The "min" property is deprecated for the Relationship field "${field.name}" and will be removed in a future version. Please use "minRows" instead.`, `(payload): The "min" property is deprecated for the Relationship field "${field.name}" and will be removed in a future version. Please use "minRows" instead.`,
) )
field.minRows = field.min
} }
if (field.max && !field.maxRows) { if (field.max && !field.maxRows) {
console.warn( console.warn(
`(payload): The "max" property is deprecated for the Relationship field "${field.name}" and will be removed in a future version. Please use "maxRows" instead.`, `(payload): The "max" property is deprecated for the Relationship field "${field.name}" and will be removed in a future version. Please use "maxRows" instead.`,
) )
field.maxRows = field.max
} }
field.minRows = field.minRows || field.min
field.maxRows = field.maxRows || field.max
} }
if (field.type === 'upload') { if (field.type === 'upload') {