adding confirmation dialog if to remove listing entirely from db or just hide it

This commit is contained in:
orangecoding
2026-02-03 14:04:40 +01:00
parent f66ceccbb4
commit 7b8e961b49
9 changed files with 415 additions and 157 deletions

View File

@@ -107,7 +107,7 @@ listingsRouter.post('/watch', async (req, res) => {
});
listingsRouter.delete('/job', async (req, res) => {
const { jobId } = req.body;
const { jobId, hardDelete = false } = req.body;
const settings = await getSettings();
try {
if (settings.demoMode) {
@@ -115,7 +115,7 @@ listingsRouter.delete('/job', async (req, res) => {
return;
}
listingStorage.deleteListingsByJobId(jobId);
listingStorage.deleteListingsByJobId(jobId, hardDelete);
} catch (error) {
res.send(new Error(error));
logger.error(error);
@@ -124,10 +124,10 @@ listingsRouter.delete('/job', async (req, res) => {
});
listingsRouter.delete('/', async (req, res) => {
const { ids } = req.body;
const { ids, hardDelete = false } = req.body;
try {
if (Array.isArray(ids) && ids.length > 0) {
listingStorage.deleteListingsById(ids);
listingStorage.deleteListingsById(ids, hardDelete);
}
} catch (error) {
res.send(new Error(error));