diff --git a/packages/backend/scripts/src/functions/pack.ts b/packages/backend/scripts/src/functions/pack.ts index 81905191..2bd841aa 100644 --- a/packages/backend/scripts/src/functions/pack.ts +++ b/packages/backend/scripts/src/functions/pack.ts @@ -8,8 +8,7 @@ const materialsFileName = 'LDConfig.ldr' const materialsFilePath = path.join(ldrawPath, materialsFileName) -console.log('Loading materials file "' + materialsFilePath + '"...') -const materialsContent = fs.readFileSync(materialsFilePath, { encoding: 'utf8' }) +var materialsContent: string = null export function packLDrawText(text: string) { const fileName = `${shortid()}.ldr` @@ -49,6 +48,12 @@ export function packLDrawFile(fileName: string) { throw 'error' } + // Loading materials content + if (!materialsContent) { + console.log('Loading materials file "' + materialsFilePath + '"...') + materialsContent = fs.readFileSync(materialsFilePath, { encoding: 'utf8' }) + } + // Obtain packed content let packedContent = materialsContent + '\n' for (let i = objectsPaths.length - 1; i >= 0; i--) { diff --git a/packages/backend/scripts/src/modules/rest/comments/comment.controller.ts b/packages/backend/scripts/src/modules/rest/comments/comment.controller.ts index 7f6c6f12..5283b425 100644 --- a/packages/backend/scripts/src/modules/rest/comments/comment.controller.ts +++ b/packages/backend/scripts/src/modules/rest/comments/comment.controller.ts @@ -38,7 +38,7 @@ export class CommentController implements CommentREST { @ApiParam({ name: 'productId', type: 'string', required: true }) @ApiParam({ name: 'issueId', type: 'string', required: true }) @ApiBody({ type: CommentCreate, required: true }) - @ApiResponse({ type: Comment }) + @ApiResponse({ type: CommentRead }) async addComment( @Param('productId') productId: string, @Param('issueId') issueId: string, @@ -67,7 +67,7 @@ export class CommentController implements CommentREST { @ApiParam({ name: 'issueId', type: 'string', required: true }) @ApiParam({ name: 'commentId', type: 'string', required: true }) @ApiBody({ type: CommentUpdate, required: true }) - @ApiResponse({ type: Comment }) + @ApiResponse({ type: CommentRead }) async updateComment( @Param('productId') productId: string, @Param('issueId') issueId: string,