From 5c5ae9912147ea7cbf5ab2ddc761f64a1ede8fd6 Mon Sep 17 00:00:00 2001 From: Roshane Pascual Date: Fri, 11 Aug 2023 17:48:40 -0700 Subject: [PATCH] fix: remove belongsto field for update related model expression (#1071) --- .../studio-ui-codegen-react-forms.test.ts.snap | 1 - .../lib/forms/form-renderer-helper/relationship.ts | 9 --------- 2 files changed, 10 deletions(-) diff --git a/packages/codegen-ui-react/lib/__tests__/__snapshots__/studio-ui-codegen-react-forms.test.ts.snap b/packages/codegen-ui-react/lib/__tests__/__snapshots__/studio-ui-codegen-react-forms.test.ts.snap index 2a2e7a1e..5ec5604a 100644 --- a/packages/codegen-ui-react/lib/__tests__/__snapshots__/studio-ui-codegen-react-forms.test.ts.snap +++ b/packages/codegen-ui-react/lib/__tests__/__snapshots__/studio-ui-codegen-react-forms.test.ts.snap @@ -15348,7 +15348,6 @@ export default function CreatePostForm(props) { input: { id: original.id, postCommentsId: post.id, - post: post, }, }, }) diff --git a/packages/codegen-ui-react/lib/forms/form-renderer-helper/relationship.ts b/packages/codegen-ui-react/lib/forms/form-renderer-helper/relationship.ts index af4450c0..29ba8b2d 100644 --- a/packages/codegen-ui-react/lib/forms/form-renderer-helper/relationship.ts +++ b/packages/codegen-ui-react/lib/forms/form-renderer-helper/relationship.ts @@ -2043,15 +2043,6 @@ const getUpdateRelatedModelExpression = ( ); }); - if (belongsToFieldOnRelatedModel) { - statements.push( - factory.createPropertyAssignment( - factory.createIdentifier(belongsToFieldOnRelatedModel), - setToNull ? factory.createNull() : factory.createIdentifier(savedModelName), - ), - ); - } - /** * API.graphql({ * query: updateStudent,