From e557db934776e21d4301a92c855ce7a97d452472 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 1 Jul 2024 17:01:16 -0700 Subject: [PATCH] simplify endpoint names --- src/widgets/stocks/component.jsx | 4 ++-- src/widgets/stocks/widget.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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"],