Fix client-side errors
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user