Skip to content

Commit ff03f8b

Browse files
committed
reverted copilot suggested changes
1 parent c0d01df commit ff03f8b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

packages/contentstack-import/src/import/modules/base-class.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -325,20 +325,20 @@ export default abstract class BaseClass {
325325
return this.stack.globalField({ api_version: '3.2' }).create(apiData).then(onSuccess).catch(onReject);
326326
case 'update-gfs':
327327
let globalFieldUid = apiData.uid ?? apiData.global_field?.uid;
328-
return this.stack
329-
.globalField(globalFieldUid, { api_version: '3.2' })
330-
.fetch()
331-
.then(async (gf) => {
332-
const updatePayload = omit(apiData, ['uid']);
333-
Object.assign(gf, updatePayload);
334-
try {
335-
const response = await gf.update();
336-
return onSuccess(response);
337-
} catch (error) {
338-
return onReject(error);
339-
}
340-
})
341-
.catch(onReject);
328+
return this.stack
329+
.globalField(globalFieldUid, { api_version: '3.2' })
330+
.fetch()
331+
.then(async (gf) => {
332+
const { uid, ...updatePayload } = cloneDeep(apiData);
333+
Object.assign(gf, updatePayload);
334+
try {
335+
const response = await gf.update();
336+
return onSuccess(response);
337+
} catch (error) {
338+
return onReject(error);
339+
}
340+
})
341+
.catch(onReject);
342342
case 'create-environments':
343343
return this.stack
344344
.environment()

0 commit comments

Comments
 (0)