fixing some bugs the wife found ;)

This commit is contained in:
orangecoding
2026-01-28 21:25:48 +01:00
parent 797421f0d5
commit bc355fb5fe
5 changed files with 22 additions and 14 deletions

View File

@@ -10,6 +10,7 @@ import { isAdmin as isAdminFn } from '../security.js';
import logger from '../../services/logger.js';
import { nullOrEmpty } from '../../utils.js';
import { getJobs } from '../../services/storage/jobStorage.js';
import { getSettings } from '../../services/storage/settingsStorage.js';
const service = restana();
@@ -107,7 +108,13 @@ listingsRouter.post('/watch', async (req, res) => {
listingsRouter.delete('/job', async (req, res) => {
const { jobId } = req.body;
const settings = await getSettings();
try {
if (settings.demoMode) {
res.send(new Error('Sorry, but you cannot remove listings in demo mode ;)'));
return;
}
listingStorage.deleteListingsByJobId(jobId);
} catch (error) {
res.send(new Error(error));