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