Skip to content

Commit 45a48aa

Browse files
committed
✨ Show erro that return of the API
1 parent 12ef475 commit 45a48aa

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/containers/FormConfirmation.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030

3131
<form class="form-confirmation" on:submit|preventDefault>
3232

33-
<WarningLabel content="Enviamos um email para você confirmar sua conta. Entre no seu email e clique no link para poder efetuar o login." />
33+
<WarningLabel
34+
content="Enviamos um email para você confirmar sua conta. Entre no seu email
35+
e clique no link para poder efetuar o login." />
3436

3537
<FieldCollab
3638
content="Não recebeu o e-mail?"

src/containers/FormSignup.svelte

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
1919
async function saveUser() {
2020
const { status, data } = await UserService.save(user)
21+
const { field, error } = data[0]
2122
2223
if (status === 201) {
2324
goto('confirmation')
@@ -50,6 +51,8 @@
5051
placeholder="Seu nome"
5152
required
5253
minlength="2"
54+
messageError={msgError.name}
55+
invalid={!!msgError.name}
5356
pattern="[A-Za-záàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ ]+"
5457
onInput={updateUser} />
5558

@@ -59,6 +62,8 @@
5962
type="email"
6063
name="email"
6164
placeholder="example@gmail.com"
65+
messageError={msgError.email}
66+
invalid={!!msgError.email}
6267
required
6368
onInput={updateUser} />
6469

@@ -70,6 +75,8 @@
7075
placeholder="********"
7176
required
7277
minlength="8"
78+
messageError={msgError.password}
79+
invalid={!!msgError.password}
7380
onInput={updateUser} />
7481

7582
<ButtonCollab content="Enviar" />

0 commit comments

Comments
 (0)