You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
514 B
24 lines
514 B
4 years ago
|
import fetchJSON from '../fetchers/fetchJSON';
|
||
|
|
||
|
async function getOneAnvil(anvilUUID: string): Promise<GetOneAnvilResponse> {
|
||
|
const response: GetOneAnvilResponse = {
|
||
|
anvilStatus: {
|
||
|
nodes: [],
|
||
|
timestamp: 0,
|
||
|
},
|
||
|
error: null,
|
||
|
};
|
||
|
|
||
|
try {
|
||
|
response.anvilStatus = await fetchJSON(
|
||
|
`${process.env.DATA_ENDPOINT_BASE_URL}/get_anvil_status?anvil_uuid=${anvilUUID}`,
|
||
|
);
|
||
|
} catch (fetchError) {
|
||
|
response.error = fetchError;
|
||
|
}
|
||
|
|
||
|
return response;
|
||
|
}
|
||
|
|
||
|
export default getOneAnvil;
|