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: entity to be Partial<Entity> | undefined in UpdateEvent #7783

Merged
merged 1 commit into from Jul 9, 2021
Merged

fix: entity to be Partial<Entity> | undefined in UpdateEvent #7783

merged 1 commit into from Jul 9, 2021

Conversation

francescoferraioli
Copy link
Contributor

@francescoferraioli francescoferraioli commented Jun 22, 2021

Description of change

This change was requested as part of #7724.

That change has made us realise that the type of UpdateEvent.entity is not strictly correct as just Entity.

  1. The UpdateEvent in case of an update, the entity was undefined
  1. The UpdateEvent in case of a soft delete, the entity is undefined
  • There is no PR to try and update this

This PR corrects the type for all scenarios which is entity: Partial<Entity> | undefined.

I decided to split this out into a seperate PR from #7724 for a number of reasons:

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run lint passes with this change
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000 (N/A)
  • There are new or updated unit tests validating the change (N/A)
  • Documentation has been updated to reflect this change (N/A)
  • The new commits follow conventions explained in CONTRIBUTING.md

@francescoferraioli francescoferraioli changed the title fix: entity to be Partial in UpdateEvent fix: entity to be Partial<Entity> | undefined in UpdateEvent Jun 22, 2021
@francescoferraioli
Copy link
Contributor Author

Thanks for approving @imnotjames. It looks like I don't have permission to merge this PR in. Is it something you do after approving?

@imnotjames imnotjames merged commit f033045 into typeorm:master Jul 9, 2021
@francescoferraioli francescoferraioli deleted the partial-entity-on-update-event branch July 11, 2021 22:53
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.

None yet

2 participants