I am designing a new web api for my project.
In my app, I have a two roles (patient and doctor). Every user can be assigned to only one role.
Every user has a own profile.
Patient can edit your profile, view, but also view doctor profile. Doctor the same thing.
How should api looks like?
/api/patient/profile GET: data for view profile
/api/patient/edit-profile GET: data for edit profile PUT: edit profile
Doctor will have it the same way.
I want to separate api for both roles. For patient always: /api/patient For doctor always: /api/doctor
The problem arises when the doctor wants to read patient data.
/api/doctor/patient/profile?userId=xxx
this approach?
Thanks
Backend: Asp Core 2.1 Frontend: React JS
Aucun commentaire:
Enregistrer un commentaire