-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
refactor(edit patient): use react-query when editing a patient #2466
refactor(edit patient): use react-query when editing a patient #2466
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/hospitalrun/hospitalrun-frontend/m8zaihnnj |
5116306
to
67b486f
Compare
67b486f
to
5108b7c
Compare
The PR is not finished yet, I opened it already for two reasons:
Also, the validation is being shared between the create and edit actions. I think I can create a new PR for the patient validation and then after is merged, I can use it her and also on #2467. Should I go for it? |
return PatientRepository.saveOrUpdate(cleanPatient) | ||
} | ||
|
||
export default function useUpdatePatient() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
upon success of the mutation, in should update the patient in the cache.
I think this sounds perfect. |
@jackcmeyer TBH, I didn't write the validator code. I just copied and pasted from the patient-slice file. I think the validator should be out of the scope of this PR. What I'm gonna do is to open a new PR for the validator and once that one is merged we can rebase this one and use it in here. Do you agree? |
@jackcmeyer Please, before moving on with this PR, take a look on this one: #2471 |
@giulianovarriale can you resolve the conflict? thanks |
I did that already on my local environment. I'm writing the hook test. Once I finished it, I'll push it. |
5f36ed8
to
48909d6
Compare
48909d6
to
5e8c990
Compare
7331f9c
to
4eb92de
Compare
4eb92de
to
960d712
Compare
dd9865f
to
23ce785
Compare
@tehkapa It is ready for review again. |
Fixes #2382.
Changes proposed in this pull request: