Adjust issue code to account for labels

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-06-26 16:02:42 +01:00
parent 72444e9fc9
commit d46a97ffa5
2 changed files with 6 additions and 3 deletions

View File

@ -2,6 +2,7 @@ const express = require('express');
const router = express.Router();
// Controller Imports
const issueCtr = require('../controllers/issue.controllers');
// Routes
@ -9,6 +10,6 @@ const router = express.Router();
router.get('/server/stats');
router.get('/server/versions');
router.post('issue');
router.post('/issue', issueCtr.post);
module.exports = router;

View File

@ -4,9 +4,11 @@ const log = require('../utils/log.utils');
async function processor(data) {
log.out('issueService.processor: Issue received', 'info');
console.log(data); // TEMPORARY MEASURE
let out = {};
out.title = data.subject.replace(/<[^>]+>|[\*\$]/g, '');
out.body = data.msg.replace(/<[^>]+>|[\*\$]/g, '');
out.labels = data?.labels;
out.title = data?.subject.replace(/<[^>]+>|[\*\$]/g, '');
out.body = data?.msg.replace(/<[^>]+>|[\*\$]/g, '');
return await sendToGitea(out);
}