fix: read stored project compiler for quartoFlavor update
Build and Deploy Verso / deploy (push) Successful in 20m28s
Build and Deploy Verso / deploy (push) Successful in 20m28s
options.compiler is set from req.body.compiler which the frontend never sends, so the condition was never true and quartoFlavor was never written. Use ProjectGetter to read the stored compiler instead. Fire-and-forget so it does not delay the compile response. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -303,14 +303,22 @@ const _CompileController = {
|
||||
|
||||
// Persist quarto output flavor so the project-list badge can distinguish
|
||||
// RevealJS presentations from PDF documents without needing a compile.
|
||||
if (status === 'success' && options.compiler === 'quarto') {
|
||||
// options.compiler is not sent by the frontend, so we read the stored
|
||||
// compiler from the DB. Done fire-and-forget so it never delays the response.
|
||||
if (status === 'success') {
|
||||
const isHtml = outputFiles.some(f => f.path === 'output.html')
|
||||
Project.updateOne(
|
||||
{ _id: projectId },
|
||||
{ quartoFlavor: isHtml ? 'revealjs' : 'pdf' }
|
||||
).exec().catch(err =>
|
||||
logger.warn({ err, projectId }, 'failed to update quartoFlavor')
|
||||
)
|
||||
ProjectGetter.promises
|
||||
.getProject(projectId, { compiler: 1 })
|
||||
.then(project => {
|
||||
if (project?.compiler !== 'quarto') return
|
||||
return Project.updateOne(
|
||||
{ _id: projectId },
|
||||
{ quartoFlavor: isHtml ? 'revealjs' : 'pdf' }
|
||||
).exec()
|
||||
})
|
||||
.catch(err =>
|
||||
logger.warn({ err, projectId }, 'failed to update quartoFlavor')
|
||||
)
|
||||
}
|
||||
|
||||
res.json({
|
||||
|
||||
Reference in New Issue
Block a user