mirror of
https://github.com/tomru/pdfer.git
synced 2026-03-03 06:27:19 +01:00
fix type errors
This commit is contained in:
@@ -68,9 +68,9 @@ export default function App() {
|
|||||||
addDocument(data)
|
addDocument(data)
|
||||||
setPdfIsLoading(false)
|
setPdfIsLoading(false)
|
||||||
setPdfUrl(url)
|
setPdfUrl(url)
|
||||||
} catch (error) {
|
} catch (error: any) {
|
||||||
setPdfIsLoading(false)
|
setPdfIsLoading(false)
|
||||||
setPdfError(error.message)
|
setPdfError(error?.message || 'Unknown error')
|
||||||
setPdfUrl(null)
|
setPdfUrl(null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ async function generateDoc(id: string): Promise<void> {
|
|||||||
const { stdout } = await execPromise(cmd, options)
|
const { stdout } = await execPromise(cmd, options)
|
||||||
stdout.length && console.log('stdout:', stdout)
|
stdout.length && console.log('stdout:', stdout)
|
||||||
console.log(`PDF ${id} generated`)
|
console.log(`PDF ${id} generated`)
|
||||||
} catch (error) {
|
} catch (error: any) {
|
||||||
console.error(error.stdout)
|
console.error(error.stdout)
|
||||||
console.error(error.toString())
|
console.error(error.toString())
|
||||||
throw new Error(error.message)
|
throw new Error(error.message)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
|||||||
await renderer(id, texDoc)
|
await renderer(id, texDoc)
|
||||||
const storeData = { ...templateData, id, created: new Date().toISOString(), template: templateName }
|
const storeData = { ...templateData, id, created: new Date().toISOString(), template: templateName }
|
||||||
res.status(200).json({ id: id, data: storeData })
|
res.status(200).json({ id: id, data: storeData })
|
||||||
} catch (err) {
|
} catch (err: any) {
|
||||||
console.error('Error:', err, 'for', req.url)
|
console.error('Error:', err, 'for', req.url)
|
||||||
res.status(500).json({ error: err.toString() })
|
res.status(500).json({ error: err.toString() })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,10 @@
|
|||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"jsx": "preserve",
|
"jsx": "preserve",
|
||||||
"lib": ["dom", "es2017"],
|
"lib": [
|
||||||
|
"dom",
|
||||||
|
"es2017"
|
||||||
|
],
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
@@ -16,8 +19,14 @@
|
|||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"target": "esnext"
|
"target": "esnext",
|
||||||
|
"incremental": true
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules"],
|
"exclude": [
|
||||||
"include": ["**/*.ts", "**/*.tsx"]
|
"node_modules"
|
||||||
|
],
|
||||||
|
"include": [
|
||||||
|
"**/*.ts",
|
||||||
|
"**/*.tsx"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user