mirror of
https://github.com/tomru/pdfer.git
synced 2026-03-03 06:27:19 +01:00
improve var naming a bit
This commit is contained in:
@@ -19,18 +19,18 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
const {
|
||||
query: { template: templateArg },
|
||||
} = req
|
||||
const options = req.body
|
||||
const templateData = req.body
|
||||
const templateName = Array.isArray(templateArg) ? templateArg[0] : templateArg
|
||||
const template = TEMPLATES[templateName]
|
||||
|
||||
if (!template) {
|
||||
res.status(404).json({ statusCode: 404, message: 'Template not specified availabe' })
|
||||
res.status(404).json({ statusCode: 404, message: 'Template not specified' })
|
||||
return
|
||||
}
|
||||
|
||||
const texDoc = template(options)
|
||||
const texDoc = template(templateData)
|
||||
const id = await renderer(texDoc)
|
||||
const storeData = Object.assign({}, options, {
|
||||
const storeData = Object.assign({}, templateData, {
|
||||
id,
|
||||
created: new Date().toISOString(),
|
||||
template: templateName,
|
||||
|
||||
Reference in New Issue
Block a user