Se creó la edge function que sirve de wrapper a carbone y ya permite descargar el pdf del plan de estudios
Por hacer: - permitir descargar los otros dos anexos tanto en pdf como en word/excel segun el caso - quitar el hardcode de convertir a pdf de downloadReport - Extraer el template id no de una variable de entorno, sino de la columna correspondiente tanto en la tabla de la estructura del plan como en la tabla de la estructura de la asignatura. En alguna parte de la BDD se tendrá que poner el template id del anexo del mapa curricular - Permitir otros métodos
This commit is contained in:
+13
-21
@@ -489,7 +489,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 6,
|
||||
"id": "caf8bc20",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -500,13 +500,13 @@
|
||||
" success: \u001b[33mtrue\u001b[39m,\n",
|
||||
" data: {\n",
|
||||
" category: \u001b[32m\"Planes de estudio\"\u001b[39m,\n",
|
||||
" comment: \u001b[32m\"Plantilla de anexo 1 SEP RVOE Acuerdo 17-11-17\"\u001b[39m,\n",
|
||||
" comment: \u001b[32m\"Plantillaaa de anexo 1 SEP RVOE Acuerdo 17-11-17\"\u001b[39m,\n",
|
||||
" versionId: \u001b[32m\"1990f3351b4313779ae3ef3caeaea14dea51c3a98a691fb90a347dec53f875e6\"\u001b[39m\n",
|
||||
" }\n",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"execution_count": 19,
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
@@ -514,13 +514,13 @@
|
||||
"source": [
|
||||
"await carbone.patchTemplate(templateID, {\n",
|
||||
" category: \"Planes de estudio\",\n",
|
||||
" comment: \"Plantilla de anexo 1 SEP RVOE Acuerdo 17-11-17\",\n",
|
||||
" comment: \"Plantillaaa de anexo 1 SEP RVOE Acuerdo 17-11-17\",\n",
|
||||
"});\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 7,
|
||||
"id": "929883b9",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -570,7 +570,7 @@
|
||||
" { download: true },\n",
|
||||
");\n",
|
||||
"\n",
|
||||
"await Deno.writeFile(\"../dist/anexo1.docx\", result.buffer);\n"
|
||||
"await Deno.writeFile(\"../anexo1.docx\", result.buffer);\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -628,16 +628,6 @@
|
||||
"await Deno.writeFile(\"../dist/anexo1.pdf\", result.buffer);\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "4528a917",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"await carbone.list"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
@@ -661,7 +651,7 @@
|
||||
" type: \"docx\",\n",
|
||||
" name: \"Anexo 1\",\n",
|
||||
" category: \"Planes de estudio\",\n",
|
||||
" comment: \"Plantilla de anexo 1 SEP RVOE Acuerdo 17-11-17\",\n",
|
||||
" comment: \"Plantillaaa de anexo 1 SEP RVOE Acuerdo 17-11-17\",\n",
|
||||
" tags: [],\n",
|
||||
" origin: 1\n",
|
||||
" }\n",
|
||||
@@ -674,10 +664,10 @@
|
||||
"source": [
|
||||
"const versions = await carbone.listTemplates({\n",
|
||||
" id: \"1373945625988937236\",\n",
|
||||
" includeVersions: true\n",
|
||||
" includeVersions: true,\n",
|
||||
"});\n",
|
||||
"\n",
|
||||
"console.log(versions);"
|
||||
"console.log(versions);\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -746,8 +736,10 @@
|
||||
"console.log(result);\n",
|
||||
"\n",
|
||||
"// const file = await carbone.downloadRender(render.data.renderId);\n",
|
||||
"const file = await carbone.downloadRender(\"X1Bx6Stre95Sm54jHxIwpQYW5leG8xLnBkZg.pdf\");\n",
|
||||
"await Deno.writeFile(\"dist/anexo1.pdf\", file.buffer);"
|
||||
"const file = await carbone.downloadRender(\n",
|
||||
" \"X1Bx6Stre95Sm54jHxIwpQYW5leG8xLnBkZg.pdf\",\n",
|
||||
");\n",
|
||||
"await Deno.writeFile(\"dist/anexo1.pdf\", file.buffer);\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user