diff --git a/src/widgets/stocks/component.jsx b/src/widgets/stocks/component.jsx index 5e73b0c25..cdf043855 100644 --- a/src/widgets/stocks/component.jsx +++ b/src/widgets/stocks/component.jsx @@ -9,7 +9,7 @@ function MarketStatus({ service }) { const { t } = useTranslation(); const { widget } = service; - const { data, error } = useWidgetAPI(widget, "stocks/market-status/us", { + const { data, error } = useWidgetAPI(widget, "status", { exchange: "US", }); @@ -46,7 +46,7 @@ function StockItem({ service, ticker }) { const { t } = useTranslation(); const { widget } = service; - const { data, error } = useWidgetAPI(widget, "stocks/quote", { symbol: ticker }); + const { data, error } = useWidgetAPI(widget, "quote", { symbol: ticker }); if (error || data?.error) { return ; diff --git a/src/widgets/stocks/widget.js b/src/widgets/stocks/widget.js index 1387bf4bb..c26274ed9 100644 --- a/src/widgets/stocks/widget.js +++ b/src/widgets/stocks/widget.js @@ -5,12 +5,12 @@ const widget = { proxyHandler: credentialedProxyHandler, mappings: { - "stocks/quote": { + quote: { // https://finnhub.io/docs/api/quote endpoint: "v1/quote", params: ["symbol"], }, - "stocks/market-status/us": { + status: { // https://finnhub.io/docs/api/market-status endpoint: "v1/stock/market-status", params: ["exchange"],