Automate issuer overlay creation from ticker searches
This commit is contained in:
@@ -10,7 +10,7 @@ import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Panel } from '@/components/ui/panel';
|
||||
import { useAuthGuard } from '@/hooks/use-auth-guard';
|
||||
import { getSearchAnswer } from '@/lib/api';
|
||||
import { ensureTickerAutomation, getSearchAnswer } from '@/lib/api';
|
||||
import { searchQueryOptions } from '@/lib/query/options';
|
||||
import type { SearchAnswerResponse, SearchResult, SearchSource } from '@/lib/types';
|
||||
|
||||
@@ -113,6 +113,13 @@ function SearchPageContent() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ticker.trim()) {
|
||||
void ensureTickerAutomation({
|
||||
ticker,
|
||||
source: 'search'
|
||||
});
|
||||
}
|
||||
|
||||
startAnswerTransition(() => {
|
||||
setError(null);
|
||||
getSearchAnswer({
|
||||
@@ -141,8 +148,15 @@ function SearchPageContent() {
|
||||
className="space-y-3"
|
||||
onSubmit={(event) => {
|
||||
event.preventDefault();
|
||||
const normalizedTicker = tickerInput.trim().toUpperCase();
|
||||
if (normalizedTicker) {
|
||||
void ensureTickerAutomation({
|
||||
ticker: normalizedTicker,
|
||||
source: 'search'
|
||||
});
|
||||
}
|
||||
setQuery(queryInput.trim());
|
||||
setTicker(tickerInput.trim().toUpperCase());
|
||||
setTicker(normalizedTicker);
|
||||
setAnswer(null);
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user