chore: suit eslint rules
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import { Response, NextFunction } from 'express';
|
||||
import User from '../models/user';
|
||||
import RequestWithCurrentUser from '../types/express/request-with-current-user';
|
||||
|
||||
const authentication = async (req: RequestWithCurrentUser, _res: Response, next: NextFunction) => {
|
||||
const authentication = async (req: RequestWithCurrentUser, _res: Response, next: NextFunction): Promise<void> => {
|
||||
// We set authentication to use the sample user we created temporarily.
|
||||
req.currentUser = await User.query().findOne({
|
||||
email: 'user@automatisch.com'
|
||||
|
@@ -1,7 +1,11 @@
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import { Request, Response } from 'express';
|
||||
import logger from './logger';
|
||||
|
||||
const errorHandler = (err: any, req: Request, res: Response, _next: NextFunction) => {
|
||||
type Error = {
|
||||
message: string;
|
||||
}
|
||||
|
||||
const errorHandler = (err: Error, req: Request, res: Response): void => {
|
||||
if(err.message === 'Not Found') {
|
||||
res.status(404).end()
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user