From e62b4cff1cf582bd621f41fb1e87120c9efce46e Mon Sep 17 00:00:00 2001 From: Matthieu Haineault Date: Mon, 18 Aug 2025 10:44:16 -0400 Subject: [PATCH] feat(attachments): minor fix and try catch for attachments controller --- src/modules/attachments/controllers/attachments.controller.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/attachments/controllers/attachments.controller.ts b/src/modules/attachments/controllers/attachments.controller.ts index 71ad827..71c7eec 100644 --- a/src/modules/attachments/controllers/attachments.controller.ts +++ b/src/modules/attachments/controllers/attachments.controller.ts @@ -19,7 +19,7 @@ import { createReadStream } from "node:fs"; import { Response } from 'express'; @Controller('attachments') -export class AttachementsController { +export class AttachmentsController { constructor( private readonly disk: DiskStorageService, private readonly prisma: PrismaService, @@ -93,7 +93,7 @@ export class AttachementsController { //Saving FS (hash + CAS + unDupes) const stream = Readable.from(file.buffer); const { sha256, storagePath, size } = await this.disk.saveStreamAndHash(stream); - + const now = new Date(); const attachment = await this.prisma.$transaction(async (tx) => { //upsert blob: +1 ref