Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessioGr committed Feb 8, 2025
1 parent 015b4eb commit 8f61411
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 21 deletions.
2 changes: 1 addition & 1 deletion packages/payload/src/database/getLocalizedPaths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function getLocalizedPaths({
for (const _block of lastIncompletePath.field.blocks) {
let block: FlattenedBlock
if (typeof _block === 'string') {
block = payload?.config?.blocks[_block]
block = payload?.blocks[_block]
} else {
block = _block
}
Expand Down
2 changes: 1 addition & 1 deletion packages/payload/src/utilities/configToJSONSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export function fieldsToJSONSchema(
? {
oneOf: field.blocks.map((block) => {
if (typeof block === 'string') {
const resolvedBlock = config?.blocks[block]
const resolvedBlock = config?.blocks?.find((b) => b.slug === block)
return {
$ref: `#/definitions/${resolvedBlock.interfaceName ?? resolvedBlock.slug}`,
}
Expand Down
5 changes: 0 additions & 5 deletions test/_community/collections/Posts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ export const PostsCollection: CollectionConfig = {
name: 'title',
type: 'text',
},
{
name: 'blocks',
type: 'blocks',
blocks: ['ConfigBlockTest'],
},
{
name: 'content',
type: 'richText',
Expand Down
11 changes: 0 additions & 11 deletions test/_community/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@ export default buildConfigWithDefaults({
},
},
editor: lexicalEditor({}),
blocks: [
{
slug: 'ConfigBlockTest',
fields: [
{
name: 'deduplicatedText',
type: 'text',
},
],
},
],
globals: [
// ...add more globals here
MenuGlobal,
Expand Down
7 changes: 4 additions & 3 deletions test/fields/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,17 @@ export const collectionSlugs: CollectionConfig[] = [
export default buildConfigWithDefaults({
collections: collectionSlugs,
globals: [TabsWithRichText],
blocks: {
ConfigBlockTest: {
blocks: [
{
slug: 'ConfigBlockTest',
fields: [
{
name: 'deduplicatedText',
type: 'text',
},
],
},
},
],
custom: {
client: {
'new-value': 'client available',
Expand Down

0 comments on commit 8f61411

Please sign in to comment.