diff --git a/api/src/controllers/match.controller.js b/api/src/controllers/match.controller.js index 596b7d93..7d5d163b 100644 --- a/api/src/controllers/match.controller.js +++ b/api/src/controllers/match.controller.js @@ -8,6 +8,7 @@ const { jwt } = require('../util/auth.util'); const process = require('../util/process.util'); const { AUTH, STORAGE } = require('../constants'); const { BAD_REQUEST } = require('../constants/http-status'); +const DETECTORS = require('../constants/config').detectors(); let matchProps = []; @@ -95,6 +96,8 @@ module.exports.delete = async (req, res) => { module.exports.reprocess = async (req, res) => { const { matchId } = req.params; + if (!DETECTORS.length) return res.status(BAD_REQUEST).error('no detectors configured'); + const db = database.connect(); let [match] = db.prepare('SELECT * FROM match WHERE id = ?').bind(matchId).all(); diff --git a/frontend/src/components/Asset.vue b/frontend/src/components/Asset.vue index 5c505cbd..fab6fb4b 100644 --- a/frontend/src/components/Asset.vue +++ b/frontend/src/components/Asset.vue @@ -227,6 +227,7 @@ export default { this.emitter.emit('reprocess', data); this.reprocessing = false; } catch (error) { + this.reprocessing = false; this.emitter.emit('error', error); } },