Skip to content

Commit

Permalink
fix(project): use json property from description blob
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristiaanScheermeijer committed Aug 23, 2021
1 parent 115e106 commit c1c0fee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/services/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const parseDeprecatedConfig = (config: Config) => {
}

try {
const { menu, id, analyticsToken, adSchedule, description, cleengId, cleengSandbox, ...options } = JSON.parse(config.description);
const { menu, id, analyticsToken, adSchedule, description, cleengId, cleengSandbox, json, ...options } = JSON.parse(config.description);

const updatedConfig = {
menu: menu || [],
Expand All @@ -127,8 +127,13 @@ const parseDeprecatedConfig = (config: Config) => {
cleengId,
cleengSandbox,
options: Object.assign(config.options, options),
json: config.json || {},
};

if (typeof json === 'object' && json !== null) {
updatedConfig.json = Object.assign(updatedConfig.json, json);
}

return Object.assign(config, updatedConfig);
} catch (error: unknown) {
throw new Error('Failed to JSON parse the `description` property');
Expand Down

0 comments on commit c1c0fee

Please sign in to comment.