Skip to content

Commit

Permalink
Merge pull request #13676 from benderillo/fix-13675-send-components
Browse files Browse the repository at this point in the history
Make updateContentTypeConfiguration endpoint return full data
  • Loading branch information
alexandrebodin committed Jul 12, 2022
2 parents d0c29fe + 89a8f91 commit ed129b8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Expand Up @@ -68,10 +68,10 @@ const useFetchContentTypeLayout = contentTypeUID => {
}, [contentTypeUID, getData]);

const updateLayout = useCallback(
newLayout => {
data => {
dispatch({
type: 'UPDATE_LAYOUT',
newLayout: formatLayouts({ contentType: newLayout, components: {} }, schemas),
newLayout: formatLayouts(data, schemas),
});
},
[schemas]
Expand Down
Expand Up @@ -107,6 +107,18 @@ module.exports = {

await metricsService.sendDidConfigureListView(contentType, newConfiguration);

ctx.body = { data: newConfiguration };
const confWithUpdatedMetadata = {
...newConfiguration,
metadatas: mapValues(assocMainField, newConfiguration.metadatas),
};

const components = await contentTypeService.findComponentsConfigurations(contentType);

ctx.body = {
data: {
contentType: confWithUpdatedMetadata,
components,
},
};
},
};

0 comments on commit ed129b8

Please sign in to comment.