Skip to content

Commit cf7acbe

Browse files
committed
fix(api-headless-cms): dynamic zone converter type
1 parent c7e4d99 commit cf7acbe

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/api-headless-cms/src/utils/converters/ConverterCollection.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ export class ConverterCollection {
6161
}
6262

6363
public getConverter(type: string): Converter {
64-
const converter = this.converters.get(type);
64+
const baseType = getBaseFieldType({ type });
65+
const converter = this.converters.get(baseType);
6566
if (converter === undefined) {
6667
throw new WebinyError(
6768
`Missing converter for field type "${type}".`,
@@ -83,8 +84,7 @@ export class ConverterCollection {
8384
this.attachHasOwnProperty(inputValues);
8485

8586
return fields.reduce<CmsEntryValues>((output, field) => {
86-
const baseType = getBaseFieldType(field);
87-
const converter = this.getConverter(baseType);
87+
const converter = this.getConverter(field.type);
8888
if (inputValues === null || inputValues.hasOwnProperty(field.fieldId) === false) {
8989
return output;
9090
}
@@ -109,8 +109,7 @@ export class ConverterCollection {
109109
}
110110

111111
return fields.reduce((output, field) => {
112-
const baseType = getBaseFieldType(field);
113-
const converter = this.getConverter(baseType);
112+
const converter = this.getConverter(field.type);
114113
if (inputValues === null || inputValues.hasOwnProperty(field.storageId) === false) {
115114
return output;
116115
}

0 commit comments

Comments
 (0)