Skip to content

Commit

Permalink
Merge pull request #50 from wp-graphql/fix/acfFieldType-null
Browse files Browse the repository at this point in the history
fix: fallback if acfFieldType is not there
  • Loading branch information
jasonbahl authored Jan 11, 2024
2 parents b396004 + 2373213 commit bf22070
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions wp-blocks/AcfFieldTypeConfigurationBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,23 @@ function generateJSONTabContent(data) {

function TabContent({ fieldTypeConfigurationBlockFields, uniqueId, format }) {
const { acfFieldType } = fieldTypeConfigurationBlockFields;

const data = generateData(uniqueId, acfFieldType);

return format === 'php' ? generatePHPTabContent(data) : generateJSONTabContent(data);
}

export function AcfFieldTypeConfigurationBlock({ fieldTypeConfigurationBlockFields }) {
const { acfFieldType } = fieldTypeConfigurationBlockFields;
if ( ! acfFieldType ) {
return (
<Card>
<CardHeader className="grid grid-cols-[1fr_110px] items-start space-y-2">
Field Type Config has not been configured for this field type
</CardHeader>
</Card>
);
};
const [uniqueId, setUniqueId] = useState('');

useEffect(() => {
Expand Down

1 comment on commit bf22070

@headless-platform-by-wp-engine

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check out the recent updates to your Atlas environment:

App Environment URL Build
acf.wpgraphql.com main https://hb…wered.com ✅ (logs)

Learn more about building on Atlas in our documentation.

Please sign in to comment.