-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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(data): make entity param partial when is not optimistic #2899
fix(data): make entity param partial when is not optimistic #2899
Conversation
- Make the entity: T parameter for the NgRx Data .add command partial when isOptimistic: false since in some cases the PK will be created on the server Closes ngrx#2870
Workflow failed and I am not entirely sure why as I do not know much about github actions, can anyone point me in the direction of what I need to do to let the workflow run? |
Preview docs changes for 6d7281b at https://previews.ngrx.io/pr2899-6d7281b6/ |
The labeler action is a false positive due to permissions. I've disabled it for now |
Gotcha! Thank you! |
Thanks @yharaskrik |
You are welcome! |
There is a bug in this PR I just found while writing the demo app for ngrx data.
This will error with:
The function overload for the Not sure how exactly to type this correctly, I wonder why TS doesn't look at the second function overload. I will read more into function overloading to see what can be done about this. |
Solved in: #2906 |
Closes #2870
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Currently NgRx Data allows the primary key to not be passed into the .add() function for an entity but the typings do not allow for that as they expect
T
Closes #2870
What is the new behavior?
Change
T
to bePartial<T>
so that functionality is represented in the types. The full object may not be available as create time if isOptimistic is false.Does this PR introduce a breaking change?
Other information