simplify endpoint names
This commit is contained in:
parent
a2a617b319
commit
e557db9347
@ -9,7 +9,7 @@ function MarketStatus({ service }) {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { widget } = service;
|
const { widget } = service;
|
||||||
|
|
||||||
const { data, error } = useWidgetAPI(widget, "stocks/market-status/us", {
|
const { data, error } = useWidgetAPI(widget, "status", {
|
||||||
exchange: "US",
|
exchange: "US",
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ function StockItem({ service, ticker }) {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { widget } = service;
|
const { widget } = service;
|
||||||
|
|
||||||
const { data, error } = useWidgetAPI(widget, "stocks/quote", { symbol: ticker });
|
const { data, error } = useWidgetAPI(widget, "quote", { symbol: ticker });
|
||||||
|
|
||||||
if (error || data?.error) {
|
if (error || data?.error) {
|
||||||
return <Container service={service} error={error} />;
|
return <Container service={service} error={error} />;
|
||||||
|
|||||||
@ -5,12 +5,12 @@ const widget = {
|
|||||||
proxyHandler: credentialedProxyHandler,
|
proxyHandler: credentialedProxyHandler,
|
||||||
|
|
||||||
mappings: {
|
mappings: {
|
||||||
"stocks/quote": {
|
quote: {
|
||||||
// https://finnhub.io/docs/api/quote
|
// https://finnhub.io/docs/api/quote
|
||||||
endpoint: "v1/quote",
|
endpoint: "v1/quote",
|
||||||
params: ["symbol"],
|
params: ["symbol"],
|
||||||
},
|
},
|
||||||
"stocks/market-status/us": {
|
status: {
|
||||||
// https://finnhub.io/docs/api/market-status
|
// https://finnhub.io/docs/api/market-status
|
||||||
endpoint: "v1/stock/market-status",
|
endpoint: "v1/stock/market-status",
|
||||||
params: ["exchange"],
|
params: ["exchange"],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user