fix: correct import path and minor issues in quartoFlavor update
Build and Deploy Verso / deploy (push) Successful in 13m44s
Build and Deploy Verso / deploy (push) Successful in 13m44s
- Fix wrong import path '../models/Project.mjs' → '../../models/Project.mjs' (from Features/Compile/, '..' is Features/, not src/; the server would crash on startup with ERR_MODULE_NOT_FOUND in Node.js ESM) - Log MongoDB errors instead of silently swallowing them - Remove null from Mongoose String enum (not a valid enum value for strings) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { pipeline } from 'node:stream/promises'
|
import { pipeline } from 'node:stream/promises'
|
||||||
import Metrics from '@overleaf/metrics'
|
import Metrics from '@overleaf/metrics'
|
||||||
import ProjectGetter from '../Project/ProjectGetter.mjs'
|
import ProjectGetter from '../Project/ProjectGetter.mjs'
|
||||||
import { Project } from '../models/Project.mjs'
|
import { Project } from '../../models/Project.mjs'
|
||||||
import CompileManager from './CompileManager.mjs'
|
import CompileManager from './CompileManager.mjs'
|
||||||
import ClsiManager from './ClsiManager.mjs'
|
import ClsiManager from './ClsiManager.mjs'
|
||||||
import logger from '@overleaf/logger'
|
import logger from '@overleaf/logger'
|
||||||
@@ -308,7 +308,9 @@ const _CompileController = {
|
|||||||
Project.updateOne(
|
Project.updateOne(
|
||||||
{ _id: projectId },
|
{ _id: projectId },
|
||||||
{ quartoFlavor: isHtml ? 'revealjs' : 'pdf' }
|
{ quartoFlavor: isHtml ? 'revealjs' : 'pdf' }
|
||||||
).exec().catch(() => {})
|
).exec().catch(err =>
|
||||||
|
logger.warn({ err, projectId }, 'failed to update quartoFlavor')
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export const ProjectSchema = new Schema(
|
|||||||
version: { type: Number }, // incremented for every change in the project structure (folders and filenames)
|
version: { type: Number }, // incremented for every change in the project structure (folders and filenames)
|
||||||
publicAccesLevel: { type: String, default: 'private' },
|
publicAccesLevel: { type: String, default: 'private' },
|
||||||
compiler: { type: String, default: settings.defaultLatexCompiler },
|
compiler: { type: String, default: settings.defaultLatexCompiler },
|
||||||
quartoFlavor: { type: String, enum: ['revealjs', 'pdf', null] },
|
quartoFlavor: { type: String, enum: ['revealjs', 'pdf'] },
|
||||||
spellCheckLanguage: { type: String, default: 'en' },
|
spellCheckLanguage: { type: String, default: 'en' },
|
||||||
deletedByExternalDataSource: { type: Boolean, default: false },
|
deletedByExternalDataSource: { type: Boolean, default: false },
|
||||||
description: { type: String, default: '' },
|
description: { type: String, default: '' },
|
||||||
|
|||||||
Reference in New Issue
Block a user