This commit is contained in:
Nikhil Nawgiri 2024-10-26 17:22:43 +02:00
parent eb99cbe544
commit 83b8c86cac
2 changed files with 15 additions and 4 deletions

View file

@ -22,8 +22,6 @@ export const fetchFromApi = async () => {
}
return response.json();
})
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
console.log("response:", response);
return response;
}

View file

@ -1,3 +1,16 @@
import { fetchFromApi } from "./fetchItemsFromJellyfin.ts";
fetchFromApi();
interface JellyfinApiResponse {
Items?: [],
TotalRecordCount?: number,
StartIndex?: number,
};
const init = async () => {
const response: JellyfinApiResponse = await fetchFromApi();
const { Items: items, TotalRecordCount: totalItemCount } = response;
console.log("items:", items);
console.log("totalItemCount:", totalItemCount);
}
init();