mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-10 22:43:11 +08:00
Backend: auth for config and queries. Refactor of middleware exports
This commit is contained in:
@@ -1,15 +1,10 @@
|
||||
const asyncWrapper = require('../../middleware/asyncWrapper');
|
||||
const App = require('../../models/App');
|
||||
const ErrorResponse = require('../../utils/ErrorResponse');
|
||||
|
||||
// @desc Update app
|
||||
// @route PUT /api/apps/:id
|
||||
// @access Public
|
||||
const updateApp = asyncWrapper(async (req, res, next) => {
|
||||
if (!req.isAuthenticated) {
|
||||
return next(new ErrorResponse('Unauthorized', 401));
|
||||
}
|
||||
|
||||
let app = await App.findOne({
|
||||
where: { id: req.params.id },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user