nox-validation 1.3.3 → 1.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/validate.js +4 -0
- package/package.json +1 -1
package/lib/validate.js
CHANGED
|
@@ -299,6 +299,7 @@ const validateMetaRules = (
|
|
|
299
299
|
let fPath = node.key;
|
|
300
300
|
|
|
301
301
|
if (fPath.includes("update.")) return;
|
|
302
|
+
if (fPath.includes("create.") && !isTranslationChild) return;
|
|
302
303
|
|
|
303
304
|
const label = formatLabel(node.display_label);
|
|
304
305
|
const message = error_messages.REQUIRED.replace("{field}", label);
|
|
@@ -974,6 +975,9 @@ const validate = (data) => {
|
|
|
974
975
|
if (!data?.language) {
|
|
975
976
|
data.language = constants.LANGUAGES.en;
|
|
976
977
|
}
|
|
978
|
+
if (!data?.language_codes) {
|
|
979
|
+
data.language_codes = [];
|
|
980
|
+
}
|
|
977
981
|
if (data.onlyFormFields === undefined) {
|
|
978
982
|
data.onlyFormFields = false;
|
|
979
983
|
}
|