Fix client-side errors

This commit is contained in:
2025-02-10 13:24:14 -05:00
parent 69f2759af5
commit 852ea63672
8 changed files with 28 additions and 20 deletions

View File

@@ -14,7 +14,7 @@ export const useCreatorProfileStore = defineStore(
() => authStore.isAuthenticated,
async (newValue) => {
if (newValue) {
await fetchCurrentCreatorProfile();
value.value = await fetchCurrentCreatorProfile();
if (value.value === undefined) {
await router.push('/');
} else {
@@ -41,9 +41,9 @@ export const useCreatorProfileStore = defineStore(
async function fetchCurrentCreatorProfile() {
try {
const creatorResponse = await client.get(`/api/creators/profile`);
value.value = creatorResponse.data;
return creatorResponse.data;
} catch (error) {
value.value = undefined;
return undefined;
}
}