fix copilot insertion so it doesn't wipe existing query text
This commit is contained in:
parent
e0cb3da6aa
commit
7ba3f39d10
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue