feat(attachments): minor fix and try catch for attachments controller
This commit is contained in:
parent
2761b75f40
commit
e62b4cff1c
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user