mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-04 15:07:13 +01:00
infer return type of functions
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { getBookingByUUID } from '../../../../db/index'
|
||||
export default async function userHandler(
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse
|
||||
) {
|
||||
): Promise<void> {
|
||||
const {
|
||||
method,
|
||||
query: { uuid: uuids },
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
export default async function userHandler(
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse
|
||||
) {
|
||||
): Promise<void> {
|
||||
const { method } = req
|
||||
|
||||
let booking: Booking
|
||||
|
||||
@@ -5,7 +5,7 @@ import { generateBookedCalendar } from '../../helpers/ical'
|
||||
export default async function useHandler(
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse
|
||||
) {
|
||||
): Promise<void> {
|
||||
const { method } = req
|
||||
|
||||
switch (method) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { getBookedDays } from '../../db/index'
|
||||
export default async function useHandler(
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse
|
||||
) {
|
||||
): Promise<void> {
|
||||
const { method } = req
|
||||
|
||||
switch (method) {
|
||||
|
||||
Reference in New Issue
Block a user