+
+
+ These are all the actively traded REITs (Real Estate Investment Trusts) on the US stock market.
+
+
+
+
+
+
+
+
+
+
+
+
+ {#each sectorList as sector}
+
+ Sector: {sector}
+
+
+
+
+
+
+ {/each}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/routes/industry/+page.ts b/src/routes/industry/+page.ts
new file mode 100644
index 00000000..090e3468
--- /dev/null
+++ b/src/routes/industry/+page.ts
@@ -0,0 +1,34 @@
+import { getCache, setCache } from "$lib/store";
+
+export const load = async ({ parent }) => {
+ const getIndustryOverview = async () => {
+ let output;
+
+ // Get cached data for the specific tickerID
+ const cachedData = getCache("", "getIndustryOverview");
+ if (cachedData) {
+ output = cachedData;
+ } else {
+ const { apiKey, apiURL } = await parent();
+
+ const response = await fetch(apiURL + "/industry-overview", {
+ method: "GET",
+ headers: {
+ "Content-Type": "application/json",
+ "X-API-KEY": apiKey,
+ },
+ });
+
+ output = await response.json();
+
+ setCache("", output, "getAllReEITs");
+ }
+
+ return output;
+ };
+
+ // Make sure to return a promise
+ return {
+ getIndustryOverview: await getIndustryOverview(),
+ };
+};
diff --git a/src/routes/list/reit-stocks/+page.ts b/src/routes/list/reit-stocks/+page.ts
index db6fa6d6..a8930b06 100644
--- a/src/routes/list/reit-stocks/+page.ts
+++ b/src/routes/list/reit-stocks/+page.ts
@@ -5,7 +5,7 @@ export const load = async ({ parent }) => {
let output;
// Get cached data for the specific tickerID
- const cachedData = getCache("", "getAllReEITs");
+ const cachedData = getCache("", "getAllREITs");
if (cachedData) {
output = cachedData;
} else {
@@ -23,7 +23,7 @@ export const load = async ({ parent }) => {
output = await response.json();
- setCache("", output, "getAllReEITs");
+ setCache("", output, "getAllREITs");
}
return output;