From 9be03784d2f7ba7915ea0c2776521ddf28728148 Mon Sep 17 00:00:00 2001 From: Nikhil Nawgiri Date: Sat, 2 Nov 2024 18:42:04 +0100 Subject: [PATCH] Add internalApiHelper --- fe/src/helper/internalApiHelper.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 fe/src/helper/internalApiHelper.ts diff --git a/fe/src/helper/internalApiHelper.ts b/fe/src/helper/internalApiHelper.ts new file mode 100644 index 0000000..06752d1 --- /dev/null +++ b/fe/src/helper/internalApiHelper.ts @@ -0,0 +1,11 @@ +const buildApiUrl = (imdbId: string) => `http://localhost:1312/check/${imdbId}`; + +export const getItemStatusInLibrary = async (imdbId: string) => { + if (imdbId.length > 0) { + fetch(buildApiUrl(imdbId)) + .then(response => response.json()) + .then(data => { + console.log("data:", data); + }); + } +}