Updated the recommendations.js route

This commit is contained in:
Mathias Wagner
2023-11-30 12:35:33 +01:00
parent d93597c37f
commit 6287278907

View File

@@ -2,9 +2,8 @@ const app = require('express').Router();
const recommendations = require('../controller/recommendations');
const password = require('../middlewares/password');
// Gets all config entries
app.get("/", password(false), async (req, res) => {
let currentRecommendations = await recommendations.get();
let currentRecommendations = await recommendations.getCurrent();
if (currentRecommendations === null) return res.status(501).json({message: "There are no recommendations yet"});
return res.json(currentRecommendations);