Skip to content

Commit e94f2dd

Browse files
committed
refactor: variant updateFileFields logic
1 parent a39b631 commit e94f2dd

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/contentstack-variants/src/import/variant-entries.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,9 @@ export default class VariantEntries extends VariantAdapter<VariantHttpClient<Imp
383383
// Check if the current property is already an object with uid and filename
384384
const existingValue = currentObj[firstKey];
385385

386-
if (
387-
!existingValue ||
388-
(typeof existingValue === 'object' && existingValue.uid && existingValue.filename)
389-
) {
386+
if (existingValue && typeof existingValue === 'object' && existingValue.uid) {
390387
currentObj[firstKey] = { uid: existingValue.uid, filename: 'dummy.jpeg' };
391-
}else {
388+
} else {
392389
currentObj[firstKey] = { uid: currentObj[firstKey], filename: 'dummy.jpeg' };
393390
}
394391
} else {

0 commit comments

Comments
 (0)