added :each support for file and relation fields

This commit is contained in:
Gani Georgiev
2024-02-25 12:19:19 +02:00
parent a8b363ed76
commit 88c56cd539
37 changed files with 119 additions and 114 deletions
+2 -6
View File
@@ -1775,13 +1775,9 @@ export default class CommonHelper {
}
}
// add ":each" field modifier
if (field.type == "select" && field.options?.maxSelect != 1) {
result.push(key + ":each");
}
// add ":length" field modifier to arrayble fields
// add ":length" and ":each" field modifiers to arrayble fields
if (field.options?.maxSelect != 1 && ["select", "file", "relation"].includes(field.type)) {
result.push(key + ":each");
result.push(key + ":length");
}
}