Implement US-03 patient profile updates
This commit is contained in:
1 parent
eb2cf2e54a
commit
a9633e49e1
8 files changed
+123
-5
No files matched your search
@@ -23,6 +23,13 @@ public sealed class PatientController(PatientApplicationService service) : Contr
|
||||
return patient is null ? NotFound() : Ok(ToDto(patient));
|
||||
}
|
||||
|
||||
[HttpPut("{patientId:guid}")]
|
||||
public async Task<ActionResult<PatientDto>> UpdatePatient(Guid patientId, UpdatePatientRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
var patient = await service.UpdatePatientAsync(patientId, request, cancellationToken);
|
||||
return patient is null ? NotFound() : Ok(ToDto(patient));
|
||||
}
|
||||
|
||||
private static PatientDto ToDto(Patient patient) =>
|
||||
new(patient.PatientId, patient.Name, patient.DateOfBirth, patient.ContactInfo);
|
||||
}
|
||||
Reference in new issue
Block a user