Skip to content

Commit 3a3ecd8

Browse files
committed
Fix uploads
1 parent eff8c09 commit 3a3ecd8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/rest/storage/storage.controller.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class StorageController {
5858
public async uploadImage(
5959
@UploadedFile() file: IFile,
6060
): Promise<UploadedImageDto> {
61-
const hash = calculateHashForBuffer(file.buffer);
61+
const hash = await calculateHashForBuffer(file.buffer);
6262
const extension = file.originalname.split(".").pop();
6363

6464
const Key = this.config.get("s3.uploadPrefix") + `${hash}.${extension}`;

src/utils/hashbuffer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// node.js
2-
import crypto from "node:crypto";
2+
import * as crypto from "node:crypto";
33

44
export async function calculateHashForArrayBuffer(
55
data: ArrayBuffer,

0 commit comments

Comments
 (0)