-
-
Account Name
-
Account ID
-
-
-
PROJECTS
- {#if $session.user}
- {#each data as account}
-
- {/each}
- {:else}
-
Nothing to see here
- {/if}
+
-
+
(toggle = !toggle)}
+ class="fixed top-0 left-0 w-full h-full z-40 bg-black bg-opacity-75
+ cursor-pointer {toggle ? 'hidden' : ''}" />
\ No newline at end of file
+ -->
diff --git a/src/helpers/accountData.js b/src/helpers/accountData.js
deleted file mode 100644
index e40a3c6..0000000
--- a/src/helpers/accountData.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import * as api from "api.js";
-
-export default async function accountData(path, token, uderId) {
- const res = await api.get(path, token, uderId)
- const data = res.data;
- return { data }
-}
\ No newline at end of file
diff --git a/src/routes/_layout.svelte b/src/routes/_layout.svelte
index d87f141..6eef4a2 100644
--- a/src/routes/_layout.svelte
+++ b/src/routes/_layout.svelte
@@ -1,11 +1,11 @@
+
+ const { session } = stores();
-
+ export let segment;
+
+ afterUpdate(async () => {
+ if ($session.user._id && $accounts.length === 0) {
+ console.log("this is only once done to avoid persisting data");
+ const res = await api.get(`accounts/`, $session.token, $session.user._id);
+ const accountData = await res.data;
+ if (!accountData) {
+ return console.log("No Account Data Returned ðŸ˜");
+ }
+ accounts.setupAccounts(accountData);
+ }
+ });
+
+
-
-
\ No newline at end of file
+
+
diff --git a/src/routes/account/[_id].svelte b/src/routes/account/[_id].svelte
index 550b9e6..ce2dbd2 100644
--- a/src/routes/account/[_id].svelte
+++ b/src/routes/account/[_id].svelte
@@ -1,49 +1,57 @@
- {accountData.accountName}
+ {accountData.accountName}
-
{accountData.accountName}
\ No newline at end of file
+ {#if projects}
+ {#each projects as project}
+
+
+ {project.projectName}
+
+
+ {:else}
+
+ No projects found or call has not been made
+
+ {/each}
+ {/if}
+
diff --git a/src/routes/accounts.svelte b/src/routes/accounts.svelte
index 95a3fe9..8e18e6a 100644
--- a/src/routes/accounts.svelte
+++ b/src/routes/accounts.svelte
@@ -1,32 +1,27 @@
-
-
\ No newline at end of file
+ {/if}
+
diff --git a/src/routes/login.svelte b/src/routes/login.svelte
index 91c48f4..b115819 100644
--- a/src/routes/login.svelte
+++ b/src/routes/login.svelte
@@ -1,106 +1,115 @@
- Login | Platform
+ Login | Platform
-
-
-

-
Sign in to continue to Platform.
+
+
+

+
Sign in to continue to Platform.
+
+