fix: bundle report db driver for survey sync

This commit is contained in:
chenpei 2026-07-03 15:29:33 +08:00
parent 3db0ce72a1
commit 739db0bb71

View File

@ -1,5 +1,6 @@
import { randomUUID } from 'crypto'
import { prisma } from '@/lib/prisma'
import mssql from 'mssql'
type ReportEmployeeRow = {
dingtalkUserId?: string | null
@ -556,8 +557,7 @@ function shouldRefreshProfile(profile: { syncedAt?: Date | null; departmentName?
}
async function getReportPool() {
const imported = await import('mssql')
const sql = (imported.default || imported) as typeof import('mssql')
const sql = mssql as typeof import('mssql')
return {
sql,
pool: await sql.connect(getReportDbConfig() as any),