infer return type of functions

This commit is contained in:
Thomas Ruoff
2021-03-22 23:14:48 +01:00
parent 3cf2aff832
commit 9fe3fffb86
16 changed files with 54 additions and 54 deletions

View File

@@ -2,7 +2,7 @@ import { Bill } from '../../../../../db/bill'
import { createBill, patchBill } from '../../../../../db/index'
import withSession, { isAdminSession } from '../../../../../lib/session'
export default withSession(async function billHandler(req, res) {
export default withSession(async function billHandler(req, res): Promise<void> {
if (!isAdminSession(req)) {
res.status(403).send({ message: 'Not Authorized' })
return

View File

@@ -7,7 +7,7 @@ import {
} from '../../../../../helpers/mail'
import { BOOKING_STATUS } from '../../../../../db/enums'
export default withSession(async function bookingHandler(req, res) {
export default withSession(async function bookingHandler(req, res): Promise<void> {
if (!isAdminSession(req)) {
res.status(403).send({ message: 'Not Authorized' })
return

View File

@@ -1,7 +1,7 @@
import { authenticateAdmin } from '../../../lib/authenticate'
import withSession from '../../../lib/session'
async function loginHandler(req: any, res: any) {
async function loginHandler(req: any, res: any): Promise<void> {
const { method } = req
switch (method) {