Skip to content

Commit

Permalink
tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed Aug 21, 2024
1 parent d5738b8 commit d098cdf
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/core/src/admin-ui/utils/useAdminMeta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,13 @@ export function useAdminMeta (adminMetaHash: string, fieldViews: FieldViews) {
for (const field of list.fields) {
for (const exportName of expectedExports) {
if ((fieldViews[field.viewsIndex] as any)[exportName] === undefined) {
throw new Error(
`The view for the field at ${list.key}.${field.path} is missing the ${exportName} export`
)
throw new Error(`The view for the field at ${list.key}.${field.path} is missing the ${exportName} export`)
}
}

Object.keys(fieldViews[field.viewsIndex]).forEach(exportName => {
if (!expectedExports.has(exportName) && exportName !== 'allowedExportsOnCustomViews') {
throw new Error(
`Unexpected export named ${exportName} from the view from the field at ${list.key}.${field.path}`
)
throw new Error(`Unexpected export named ${exportName} from the view from the field at ${list.key}.${field.path}`)
}
})

Expand Down

0 comments on commit d098cdf

Please sign in to comment.