Fix task poller callback staleness and normalize filings query

This commit is contained in:
2026-02-27 01:03:59 -05:00
parent cff77ce193
commit e7320f3bdb
3 changed files with 23 additions and 8 deletions

View File

@@ -153,11 +153,21 @@ export async function getLatestPortfolioInsight() {
}
export async function listFilings(query?: { ticker?: string; limit?: number }) {
const queryParams: {
ticker?: string;
limit?: number;
} = {};
if (query?.ticker?.trim()) {
queryParams.ticker = query.ticker.trim().toUpperCase();
}
if (query?.limit !== undefined) {
queryParams.limit = query.limit;
}
const result = await client.api.filings.get({
$query: {
ticker: query?.ticker,
limit: query?.limit
}
$query: queryParams
});
return await unwrapData<{ filings: Filing[] }>(result, 'Unable to fetch filings');