Make ticket body customizable

This commit is contained in:
Girish Ramakrishnan
2019-05-10 17:13:05 -07:00
parent a54be69c96
commit 97d2494fe3
3 changed files with 19 additions and 2 deletions

View File

@@ -18,6 +18,8 @@ var appstore = require('../appstore.js'),
function createTicket(req, res, next) {
assert.strictEqual(typeof req.user, 'object');
if (!custom.spec().support.submitTickets) return next(new HttpError(405, 'feature disabled by admin'));
const VALID_TYPES = [ 'feedback', 'ticket', 'app_missing', 'app_error', 'upgrade_request' ];
if (typeof req.body.type !== 'string' || !req.body.type) return next(new HttpError(400, 'type must be string'));