mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Fix lint and tests
This commit is contained in:
parent
4f4d3adf73
commit
985e79f61e
7 changed files with 40 additions and 37 deletions
|
@ -1,6 +1,6 @@
|
|||
import { ExpressPromiseHandler } from '@server/types/express-handler.js'
|
||||
import { NextFunction, Request, RequestHandler, Response } from 'express'
|
||||
import { ValidationChain } from 'express-validator'
|
||||
import { ExpressPromiseHandler } from '@server/types/express-handler.js'
|
||||
import { retryTransactionWrapper } from '../helpers/database-utils.js'
|
||||
|
||||
// Syntactic sugar to avoid try/catch in express controllers/middlewares
|
||||
|
@ -15,7 +15,7 @@ function asyncMiddleware (fun: RequestPromiseHandler | RequestPromiseHandler[])
|
|||
}
|
||||
|
||||
try {
|
||||
for (const f of (fun as RequestPromiseHandler[])) {
|
||||
for (const f of fun) {
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
return asyncMiddleware(f)(req, res, err => {
|
||||
if (err) return reject(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue