mirror of
https://github.com/Troplo/Colubrina.git
synced 2024-11-23 03:36:42 +11:00
25 lines
586 B
JavaScript
25 lines
586 B
JavaScript
const express = require("express")
|
|
const router = express.Router()
|
|
const Errors = require("../lib/errors.js")
|
|
const auth = require("../lib/authorize.js")
|
|
const { Feedback } = require("../models")
|
|
|
|
router.post("/", auth, async (req, res, next) => {
|
|
try {
|
|
await Feedback.create({
|
|
feedbackText: req.body.text,
|
|
starRating: req.body.starRating,
|
|
debug: {
|
|
client: req.body.debug
|
|
},
|
|
route: req.body.route,
|
|
userId: req.user.id,
|
|
tenant: "colubrina"
|
|
})
|
|
res.sendStatus(204)
|
|
} catch (e) {
|
|
next(e)
|
|
}
|
|
})
|
|
|
|
module.exports = router
|