Skip to content

Commit 508d200

Browse files
committed
Return json format for UploadConversationMessageFiles
1 parent 7a7fc0b commit 508d200

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Infrastructure/BotSharp.OpenAPI/Controllers/ConversationController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,15 +483,15 @@ public IActionResult UploadAttachments([FromRoute] string conversationId, IFormF
483483
}
484484

485485
[HttpPost("/agent/{agentId}/conversation/{conversationId}/upload")]
486-
public async Task<string> UploadConversationMessageFiles([FromRoute] string agentId, [FromRoute] string conversationId, [FromBody] InputMessageFiles input)
486+
public async Task<IActionResult> UploadConversationMessageFiles([FromRoute] string agentId, [FromRoute] string conversationId, [FromBody] InputMessageFiles input)
487487
{
488488
var convService = _services.GetRequiredService<IConversationService>();
489489
convService.SetConversationId(conversationId, input.States);
490490
var conv = await convService.GetConversationRecordOrCreateNew(agentId);
491491
var fileStorage = _services.GetRequiredService<IFileStorageService>();
492492
var messageId = Guid.NewGuid().ToString();
493493
var isSaved = fileStorage.SaveMessageFiles(conv.Id, messageId, FileSource.User, input.Files);
494-
return isSaved ? messageId : string.Empty;
494+
return Ok(new { messageId = isSaved ? messageId : string.Empty });
495495
}
496496

497497
[HttpGet("/conversation/{conversationId}/files/{messageId}/{source}")]

0 commit comments

Comments
 (0)