simplify endpoint names

This commit is contained in:
shamoon
2024-07-01 17:01:16 -07:00
parent a2a617b319
commit e557db9347
2 changed files with 4 additions and 4 deletions

View File

@@ -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 <Container service={service} error={error} />;

View File

@@ -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"],