Skip to content

Commit

Permalink
skip required validation for blocks (#3128)
Browse files Browse the repository at this point in the history
  • Loading branch information
agalin920 authored Jan 13, 2025
1 parent bbfaae2 commit b50aac4
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions src/shell/store/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -580,20 +580,26 @@ export function createItem({ modelZUID, itemZUID, skipPathPartValidation }) {

// Check required fields are not empty, except the og and tc fields since these
// are handled by the meta component
const missingRequired = fields.filter((field) => {
if (
!field.deletedAt &&
!["og_title", "og_description", "tc_title", "tc_description"].includes(
field.name
) &&
field.required
) {
if (!item.data[field.name] && item.data[field.name] != 0) {
return true;
}
}
return false;
});
const missingRequired =
model?.type === "block"
? false
: fields.filter((field) => {
if (
!field.deletedAt &&
![
"og_title",
"og_description",
"tc_title",
"tc_description",
].includes(field.name) &&
field.required
) {
if (!item.data[field.name] && item.data[field.name] != 0) {
return true;
}
}
return false;
});

const hasMissingRequiredSEOFields = skipPathPartValidation
? !item?.web?.metaTitle
Expand Down

0 comments on commit b50aac4

Please sign in to comment.