medicalHistory: deletion when patient is deleted
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using Application.Endpoints;
|
||||
using Application.Endpoints.Appointments;
|
||||
using Application.Services.Database;
|
||||
using Application.Services.Database.MongoDB;
|
||||
using Application.Services.Database.PostgreSQL;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace API.Controllers;
|
||||
@@ -9,8 +9,8 @@ namespace API.Controllers;
|
||||
public class AppointmentsController : BaseApiController
|
||||
{
|
||||
private readonly IAppointmentsMongoDbService _appointmentsMongoDbService;
|
||||
private readonly IPatientRepository _patientRepository;
|
||||
private readonly IDoctorRepository _doctorRepository;
|
||||
private readonly IPatientRepository _patientRepository;
|
||||
|
||||
public AppointmentsController(IAppointmentsMongoDbService appointmentsMongoDbService,
|
||||
IPatientRepository patientRepository, IDoctorRepository doctorRepository)
|
||||
@@ -23,7 +23,8 @@ public class AppointmentsController : BaseApiController
|
||||
[HttpPost]
|
||||
public async Task<ActionResult<BaseResponse>> CreateAppointment(AppointmentManagementDto dto)
|
||||
{
|
||||
var handler = new AppointmentManagementHandler(_appointmentsMongoDbService, _patientRepository, _doctorRepository);
|
||||
var handler =
|
||||
new AppointmentManagementHandler(_appointmentsMongoDbService, _patientRepository, _doctorRepository);
|
||||
var response = await handler.HandleCreateAppointment(dto).ConfigureAwait(false);
|
||||
return StatusCode(response.StatusCode, response);
|
||||
}
|
||||
@@ -31,7 +32,8 @@ public class AppointmentsController : BaseApiController
|
||||
[HttpDelete]
|
||||
public async Task<ActionResult<BaseResponse>> DeleteAppointment(AppointmentManagementDto dto)
|
||||
{
|
||||
var handler = new AppointmentManagementHandler(_appointmentsMongoDbService, _patientRepository, _doctorRepository);
|
||||
var handler =
|
||||
new AppointmentManagementHandler(_appointmentsMongoDbService, _patientRepository, _doctorRepository);
|
||||
var response = await handler.HandleDeleteAppointment(dto).ConfigureAwait(false);
|
||||
return StatusCode(response.StatusCode, response);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user