Added tokeCommand delete endpoint and ajax call, replaced all raw error responses.
This commit is contained in:
parent
af7f4219a5
commit
864304f13b
28 changed files with 93 additions and 64 deletions
|
|
@ -20,7 +20,7 @@ const {validationResult, matchedData} = require('express-validator');
|
|||
//local imports
|
||||
const {userModel} = require('../../../schemas/userSchema');
|
||||
const accountUtils = require('../../../utils/sessionUtils.js');
|
||||
const {exceptionHandler} = require('../../../utils/loggerUtils.js');
|
||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils.js');
|
||||
|
||||
//api account functions
|
||||
module.exports.post = async function(req, res){
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ const {validationResult, matchedData} = require('express-validator');
|
|||
|
||||
//local imports
|
||||
const accountUtils = require('../../../utils/sessionUtils.js');
|
||||
const {exceptionHandler} = require('../../../utils/loggerUtils.js');
|
||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils.js');
|
||||
|
||||
|
||||
//api account functions
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
|||
|
||||
//local imports
|
||||
const accountUtils = require('../../../utils/sessionUtils.js');
|
||||
const {exceptionHandler} = require('../../../utils/loggerUtils.js');
|
||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils.js');
|
||||
|
||||
module.exports.get = async function(req, res){
|
||||
if(req.session.user){
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
|||
|
||||
//local imports
|
||||
const permissionModel = require('../../../schemas/permissionSchema.js');
|
||||
const {exceptionHandler} = require('../../../utils/loggerUtils.js');
|
||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils.js');
|
||||
|
||||
//api account functions
|
||||
module.exports.get = async function(req, res){
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ const {validationResult, matchedData} = require('express-validator');
|
|||
//local imports
|
||||
const {userModel} = require('../../../schemas/userSchema');
|
||||
const userBanModel = require('../../../schemas/userBanSchema.js');
|
||||
const {exceptionHandler} = require('../../../utils/loggerUtils.js');
|
||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils.js');
|
||||
|
||||
module.exports.post = async function(req, res){
|
||||
try{
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ const {validationResult, matchedData} = require('express-validator');
|
|||
//local imports
|
||||
const {userModel} = require('../../../schemas/userSchema');
|
||||
const accountUtils = require('../../../utils/sessionUtils.js');
|
||||
const {exceptionHandler} = require('../../../utils/loggerUtils.js');
|
||||
const {exceptionHandler, errorHandler} = require('../../../utils/loggerUtils.js');
|
||||
|
||||
module.exports.post = async function(req, res){
|
||||
const validResult = validationResult(req);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue