Major Backend SI Update part 2: added controllers

This commit is contained in:
X4Lo committed 2025-02-15 22:42:57 +01:00
1 parent a51e207707
commit dbb00fdb61
38 files changed
+2129 -1231

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
const episodeService = require("../services/episodeService");
const _episodeService = episodeService;
class EpisodeController {
constructor() {
if (!EpisodeController.instance) {
EpisodeController.instance = this;
}
return EpisodeController.instance;
}
async getEpisodesBetweenDates(req, res) {
const { startDate, endDate } = req.params;
try {
const episodes = await _episodeService.getEpisodesBetweenDates(startDate, endDate)
res.status(200).json(episodes);
} catch (error) {
res.status(500).json({ error: error.message });
}
}
}
module.exports = new EpisodeController();