11import betterSqlite3 from 'better-sqlite3' ;
22import express from 'express' ;
33import AdminForth , { AdminUser , Filters } from '../adminforth/index.js' ;
4-
4+ import type { IAdminUserExpressRequest , ITranslateExpressRequest } from 'adminforth' ;
55import clicksResource from './resources/clicks.js' ;
66import apartmentsResource from './resources/apartments.js' ;
77import apartmentBuyersResource from './resources/apartment_buyers.js' ;
@@ -901,7 +901,7 @@ const port = process.env.PORT || 3000;
901901app . get (
902902 '/api/testtest/' ,
903903 admin . express . authorize (
904- async ( req : express . Request , res : express . Response , next : express . NextFunction ) => {
904+ async ( req : IAdminUserExpressRequest , res : express . Response , next : express . NextFunction ) => {
905905 res . json ( { ok : true , data : [ 1 , 2 , 3 ] , adminUser : req . adminUser } ) ;
906906 }
907907 )
@@ -910,7 +910,7 @@ app.get(
910910app . get ( `${ ADMIN_BASE_URL } /api/dashboard/` ,
911911 admin . express . authorize (
912912 admin . express . translatable (
913- async ( req : any , res : express . Response ) => {
913+ async ( req : IAdminUserExpressRequest & ITranslateExpressRequest , res : express . Response ) => {
914914 const days = req . body . days || 7 ;
915915 const apartsByDays = await admin . resource ( 'aparts' ) . dataConnector . client . prepare (
916916 `SELECT
@@ -1010,7 +1010,7 @@ app.get(`${ADMIN_BASE_URL}/api/dashboard/`,
10101010
10111011app . get ( `${ ADMIN_BASE_URL } /api/aparts-by-room-percentages/` ,
10121012 admin . express . authorize (
1013- async ( req , res ) => {
1013+ async ( req : IAdminUserExpressRequest , res : express . Response ) => {
10141014 const roomPercentages = await admin . resource ( 'aparts' ) . dataConnector . client . prepare (
10151015 `SELECT
10161016 number_of_rooms,
0 commit comments