Skip to content

Commit

Permalink
fix: don't reprocess if no detectors configured
Browse files Browse the repository at this point in the history
  • Loading branch information
jakowenko committed Sep 11, 2021
1 parent 3c21da6 commit 157e7c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/src/controllers/match.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];

Expand Down Expand Up @@ -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();

Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/Asset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ export default {
this.emitter.emit('reprocess', data);
this.reprocessing = false;
} catch (error) {
this.reprocessing = false;
this.emitter.emit('error', error);
}
},
Expand Down

0 comments on commit 157e7c7

Please sign in to comment.