fix copilot insertion so it doesn't wipe existing query text

This commit is contained in:
Ashley Stanton-Nurse 2024-04-17 10:36:28 -07:00
parent e0cb3da6aa
commit 7ba3f39d10
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -218,7 +218,7 @@ export const QueryCopilotPromptbar: React.FC<QueryCopilotPromptProps> = ({
generateSQLQueryResponse.explanation ? generateSQLQueryResponse.explanation : "N/A" generateSQLQueryResponse.explanation ? generateSQLQueryResponse.explanation : "N/A"
}\r\n`; }\r\n`;
const currentGeneratedQuery = queryExplanation + generateSQLQueryResponse.sql; const currentGeneratedQuery = queryExplanation + generateSQLQueryResponse.sql;
const lastQuery = generatedQuery && query ? `${query}\r\n` : ""; const lastQuery = query ? `${query}\r\n` : "";
setQuery(`${lastQuery}${currentGeneratedQuery}`); setQuery(`${lastQuery}${currentGeneratedQuery}`);
setGeneratedQuery(generateSQLQueryResponse.sql); setGeneratedQuery(generateSQLQueryResponse.sql);
setGeneratedQueryComments(generateSQLQueryResponse.explanation); setGeneratedQueryComments(generateSQLQueryResponse.explanation);