From 671527634a8f04f6ff0124d1f30d6bb35e906101 Mon Sep 17 00:00:00 2001 From: sdcb Date: Wed, 22 Jan 2025 18:38:34 +0800 Subject: [PATCH] fix a issue that cannot edit-and-save-new --- src/BE/Controllers/Chats/Messages/MessagesController.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/BE/Controllers/Chats/Messages/MessagesController.cs b/src/BE/Controllers/Chats/Messages/MessagesController.cs index 0559097f..77698299 100644 --- a/src/BE/Controllers/Chats/Messages/MessagesController.cs +++ b/src/BE/Controllers/Chats/Messages/MessagesController.cs @@ -155,6 +155,9 @@ public async Task> EditAndSaveNew(string encrypt Message? message = await db.Messages .Include(x => x.Chat) .Include(x => x.Usage) + .Include(x => x.Usage!.UserModel) + .Include(x => x.Usage!.UserModel.Model) + .Include(x => x.Usage!.UserModel.Model.ModelKey) .FirstOrDefaultAsync(x => x.Id == messageId, cancellationToken); if (message == null) { @@ -181,6 +184,7 @@ public async Task> EditAndSaveNew(string encrypt newMessage.Usage = new UserModelUsage() { UserModelId = message.Usage.UserModelId, + UserModel = message.Usage.UserModel, FinishReasonId = (byte)DBFinishReason.Success, SegmentCount = 1, InputTokens = message.Usage.InputTokens,