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

@@ -27,14 +27,12 @@ async function createAccount() {
isOperationPending.value = true;
const client = useClient();
errorMessage.value = '';
const normalizedCreatorName = creatorName.value.toLowerCase();
await client.post('/api/creators', {
creatorId: userProfileStore.user.id,
name: normalizedCreatorName,
slugReservationId: creatorNameReservationId.value,
});
await creatorProfileStore.fetchCurrentCreatorProfile();
await router.push(`/@${normalizedCreatorName}`);
await router.push(`/@${creatorProfileStore.creator.name}`);
} catch (error) {
if (error?.response?.data?.errors) {
errorMessage.value = error.response.data.errors[0]?.['reason'] || 'An unexpected error occurred.';