Преглед изворни кода

Refactor for document return

Shun Miyazawa пре 1 година
родитељ
комит
ba759e95ee
1 измењених фајлова са 4 додато и 2 уклоњено
  1. 4 2
      apps/app/src/features/openai/server/services/openai.ts

+ 4 - 2
apps/app/src/features/openai/server/services/openai.ts

@@ -614,10 +614,12 @@ class OpenaiService implements IOpenaiService {
 
     const newData = {
       ...data,
-      vectorStore: newVectorStoreRelation, // If undefined, it is not updated
+      vectorStore: newVectorStoreRelation ?? aiAssistant.vectorStore,
     };
 
-    const updatedAiAssistant = await aiAssistant.update(newData, { new: true });
+    aiAssistant.set({ ...newData });
+    const updatedAiAssistant = await aiAssistant.save();
+
     return updatedAiAssistant;
   }