Skip to content

Commit

Permalink
admin usecase names updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sinanptm committed Oct 8, 2024
1 parent 84b27ea commit 8c978c2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { NextFunction, Request, Response } from "express";
import AdminDoctorUseCase from "../../../use_case/admin/DoctorUseCase";
import AdminDoctorUseCase from "../../../use_case/admin/AdminDoctorUseCase";
import { DoctorsFilter, StatusCode } from "../../../types";
import IDoctor from "../../../domain/entities/IDoctor";

export default class AdminDoctorController {
constructor(
private doctorUseCase: AdminDoctorUseCase
private adminDoctorUseCase: AdminDoctorUseCase
) {}

async getDoctors(req: Request, res: Response, next: NextFunction) {
Expand All @@ -20,7 +20,7 @@ export default class AdminDoctorController {
const validTypes = [DoctorsFilter.BLOCKED, DoctorsFilter.VERIFIED, DoctorsFilter.NOT_VERIFIED];
const doctorType = validTypes.includes(type) ? type : DoctorsFilter.VERIFIED;

const doctors = await this.doctorUseCase.getAll(offset, limit, doctorType);
const doctors = await this.adminDoctorUseCase.getAll(offset, limit, doctorType);
res.status(StatusCode.Success).json(doctors);
} catch (error) {
next(error);
Expand All @@ -32,7 +32,7 @@ export default class AdminDoctorController {
const doctor: IDoctor = req.body;
if (!doctor) return res.status(StatusCode.BadRequest).json({ message: "Doctor Details is Required" });
if (!doctor._id) return res.status(StatusCode.BadRequest).json({ message: "Id is Required" });
await this.doctorUseCase.update(doctor);
await this.adminDoctorUseCase.update(doctor);
res.status(StatusCode.Success).json({ message: "Doctor has verified" });
} catch (error) {
next(error);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NextFunction, Request, Response } from "express";
import AdminPatientUseCase from "../../../use_case/admin/PatientUseCase";
import AdminPatientUseCase from "../../../use_case/admin/AdminPatientUseCase";
import { StatusCode } from "../../../types";

export default class AdminPatientController {
Expand Down
8 changes: 4 additions & 4 deletions server/src/presentation/routers/admin/AdminRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { Router } from "express";
import AppointmentRepository from "../../../infrastructure/repositories/AppointmentRepository";
import PatientRepository from "../../../infrastructure/repositories/PatientRepository";
import DoctorRepository from "../../../infrastructure/repositories/DoctorRepository";
import AdminPatientController from "../../controllers/admin/AdminPatientController";
import NodeMailerService from "../../../infrastructure/services/NodeMailerService";
import AdminDoctorController from "../../controllers/admin/AdminDoctorController";
import SlotRepository from "../../../infrastructure/repositories/SlotRepository";
import AdminPatientController from "../../controllers/admin/PatientController";
import AdminDoctorController from "../../controllers/admin/DoctorController";
import AdminPatientUseCase from "../../../use_case/admin/AdminPatientUseCase";
import AdminDashBoardUseCase from "../../../use_case/admin/DashboardUseCase";
import AdminPatientUseCase from "../../../use_case/admin/PatientUseCase";
import AdminDoctorUseCase from "../../../use_case/admin/DoctorUseCase";
import AdminDoctorUseCase from "../../../use_case/admin/AdminDoctorUseCase";
import AdminController from "../../controllers/admin/AdminController";
import JoiService from "../../../infrastructure/services/JoiService";

Expand Down
File renamed without changes.
File renamed without changes.

1 comment on commit 8c978c2

@vercel
Copy link

@vercel vercel bot commented on 8c978c2 Oct 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.