Skip to content

Commit

Permalink
Fix Baboo7#91 Find all components in imported file
Browse files Browse the repository at this point in the history
  • Loading branch information
mitenka authored and Baboo7 committed Apr 20, 2023
1 parent 87fb93d commit b260aa5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/server/services/import/import-v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ const { findOrImportFile } = require('./utils/file');
*/
const importDataV2 = async (fileContent, { slug, user, idField }) => {
const { data } = fileContent;
const components = {};

for (const [key, value] of Object.entries(data)) {
if (getModel(key).modelType === 'component') {
components[key] = Object.values(value);
}
}

// Sorry, dudes, I'm tipsy.
importDataV2.components = components;

const slugs = Object.keys(data);
let failures = [];
Expand Down

0 comments on commit b260aa5

Please sign in to comment.