add an error service, base controller

This commit is contained in:
Alex Holliday committed 2025-07-24 15:06:46 -07:00
1 parent 0cfe9d60fb
commit ddf3e8251d
20 files changed
+412 -301

No files matched your search

+7 -6
View File
@@ -1,14 +1,15 @@
import { asyncHandler } from "../utils/errorUtils.js";
import BaseController from "./baseController.js";
const SERVICE_NAME = "LogController";
class LogController {
constructor(logger) {
class LogController extends BaseController {
constructor({ logger, errorService }) {
super();
this.logger = logger;
this.errorService = errorService;
}
getLogs = asyncHandler(
async (req, res, next) => {
getLogs = this.asyncHandler(
async (req, res) => {
const logs = await this.logger.getLogs();
res.success({
msg: "Logs fetched successfully",