Shun Miyazawa 1 год назад
Родитель
Сommit
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;
   }