fix: typos in Anvils and fetcher

main
Josue 4 years ago committed by Tsu-ba-me
parent 4d2c140234
commit 1ed509e497
  1. 5
      striker-ui/components/Anvils/index.tsx
  2. 2
      striker-ui/lib/fetchers/periodicFetch.ts

@ -10,16 +10,13 @@ const Anvils = ({ list }: { list: AnvilList | undefined }): JSX.Element => {
list?.anvils.forEach((anvil: AnvilListItem) => { list?.anvils.forEach((anvil: AnvilListItem) => {
const { data } = PeriodicFetch<AnvilStatus>( const { data } = PeriodicFetch<AnvilStatus>(
`${process.env.NEXT_PUBLIC_API_URL}/anvils/get_status?anvil_uuid= `${process.env.NEXT_PUBLIC_API_URL}/anvils/get_status?anvil_uuid=${anvil.anvil_uuid}`,
${anvil.anvil_uuid}`,
); );
/* eslint-disable no-param-reassign */
anvils.push({ anvils.push({
...anvil, ...anvil,
anvil_state: data?.anvil_state, anvil_state: data?.anvil_state,
}); });
}); });
return ( return (
<Panel> <Panel>
<SelectedAnvil list={anvils} /> <SelectedAnvil list={anvils} />

@ -5,7 +5,7 @@ const PeriodicFetch = <T>(
url: string, url: string,
refreshInterval = 5000, refreshInterval = 5000,
): GetResponses => { ): GetResponses => {
const { data, error } = useSWR<T>(`${url}`, fetcher, { const { data, error } = useSWR<T>(url, fetcher, {
refreshInterval, refreshInterval,
}); });
return { return {

Loading…
Cancel
Save