Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix composite field creation #9044

Merged
merged 1 commit into from
Dec 12, 2024
Merged

Fix composite field creation #9044

merged 1 commit into from
Dec 12, 2024

Conversation

thomtrp
Copy link
Contributor

@thomtrp thomtrp commented Dec 12, 2024

  • composite field need to be formatted before being saved
  • repository.create() does not do it. So we simply lose the composite fields on the way
  • save() does it directly and doing create() before does not change anything

Copy link
Member

@Weiko Weiko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thomtrp thomtrp enabled auto-merge (squash) December 12, 2024 16:26
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR modifies the record creation workflow to fix composite field handling by simplifying the save operation.

  • Changed create-record.workflow-action.ts to use direct repository.save() instead of repository.create() followed by save()
  • Fixes issue where composite fields were being lost during record creation
  • Removes intermediate validation step from repository.create()
  • Ensures proper formatting of composite fields before database persistence
  • Impacts workflow record creation functionality in twentyhq/twenty

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +20 to 22
const objectRecord = await repository.save(
workflowActionInput.objectRecord,
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Directly calling save() bypasses entity validation that create() provides. Consider wrapping in try/catch to handle validation errors gracefully.

@thomtrp thomtrp merged commit 2990d23 into main Dec 12, 2024
19 checks passed
@thomtrp thomtrp deleted the tt-fix-composite-creation branch December 12, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants