File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -143,8 +143,8 @@ async def rename_conversation():
143143
144144 # update the title
145145 title = request_json .get ("title" , None )
146- if not title :
147- return ( jsonify ({"error" : "title is required" }), 400 )
146+ if not title or title . strip () == "" :
147+ return jsonify ({"error" : "title is required" }), 400
148148 conversation ["title" ] = title
149149 updated_conversation = await cosmos_conversation_client .upsert_conversation (
150150 conversation
@@ -321,7 +321,10 @@ async def delete_all_conversations():
321321
322322 except Exception as e :
323323 logger .exception ("Exception in /delete" + str (e ))
324- return (jsonify ({"error" : "Error while deleting all history conversation" }), 500 )
324+ return (
325+ jsonify ({"error" : "Error while deleting all history conversation" }),
326+ 500 ,
327+ )
325328
326329
327330@bp_chat_history_response .route ("/history/update" , methods = ["POST" ])
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ export const ChatHistoryListItemCell: React.FC<
126126
127127 const handleSaveEdit = async ( e : any ) => {
128128 e . preventDefault ( ) ;
129- if ( errorRename || renameLoading ) {
129+ if ( errorRename || renameLoading || _ . trim ( editTitle ) === "" ) {
130130 return ;
131131 }
132132
@@ -219,7 +219,7 @@ export const ChatHistoryListItemCell: React.FC<
219219 disabled = { errorRename ? true : false }
220220 />
221221 </ Stack . Item >
222- { editTitle && (
222+ { _ . trim ( editTitle ) && (
223223 < Stack . Item >
224224 < Stack
225225 aria-label = "action button group"
You can’t perform that action at this time.
0 commit comments