🔧 fix: explicit factory return type on createAdminAuditLogHandlers

Same tsdown --isolatedDeclarations migration that hit packages/data-schemas
also applies to packages/api; the audit-log handler factory's inferred
return type tripped TS9013 against the new build pipeline. Annotated the
factory with explicit handler signatures matching the sibling
createAdminGrantsHandlers convention. Used Promise<Response | void> for
the export handler because its final res.end() path returns undefined,
unlike the other two handlers which always return a Response.
This commit is contained in:
Dustin Healy 2026-06-09 12:45:54 -07:00 • committed by Danny Avila
parent cefaaf0530
commit 1ca6877caa

View file

@ -257,7 +257,11 @@ function parseFilters(
};
}
export function createAdminAuditLogHandlers(deps: AdminAuditLogDeps) {
export function createAdminAuditLogHandlers(deps: AdminAuditLogDeps): {
listAuditLog: (req: ServerRequest, res: Response) => Promise<Response>;
getAuditLogEntry: (req: ServerRequest, res: Response) => Promise<Response>;
exportAuditLogCsv: (req: ServerRequest, res: Response) => Promise<Response | void>;
} {
const { listAuditLogPage, findAuditLogEntry, streamAuditLogEntries } = deps;
async function listAuditLogHandler(req: ServerRequest, res: Response) {