Skip to content

Commit 8e23e25

Browse files
committed
live-demo: add type annotations for request and response in authorization middleware
1 parent f93d216 commit 8e23e25

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

live-demo/app/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import express from 'express';
2+
import type { Request, Response } from 'express';
23
import AdminForth, { Filters } from 'adminforth';
34
import type { AdminUser } from 'adminforth';
45
import fs from 'fs';
@@ -181,7 +182,7 @@ if (import.meta.url === `file://${process.argv[1]}`) {
181182
},
182183
},
183184
admin.express.authorize(
184-
async (req, res) => {
185+
async (req: Request, res: Response) => {
185186
const db = admin.resource('aparts').dataConnector.client;
186187
const days = req.body.days || 7;
187188
const apartsByDays = await db.prepare(

0 commit comments

Comments
 (0)