xiongzhu 3 years ago
parent
commit
cfaff98e7c
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/chat-pdf/chat-pdf.service.ts

+ 5 - 1
src/chat-pdf/chat-pdf.service.ts

@@ -71,7 +71,11 @@ export class ChatPdfService {
     public async upload(file: Express.Multer.File) {
         const { originalname, buffer, mimetype } = file
         const md5 = this.calculateMD5(buffer)
-        const res = await ChatEmbedding.findAll()
+        const res = await ChatEmbedding.findAll({
+            where: {
+                name: md5
+            }
+        })
         if (res.length) {
             return {
                 name: md5