소스 검색

ajustes cadastro prestador para nao gerar aprovado e bloquear pendentes

Gustavo Zanatta 3 주 전
부모
커밋
d8ca54e86e
4개의 변경된 파일33개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 0
      src/i18n/locales/en.json
  2. 5 0
      src/i18n/locales/es.json
  3. 5 0
      src/i18n/locales/pt.json
  4. 18 3
      src/pages/LoginPage.vue

+ 5 - 0
src/i18n/locales/en.json

@@ -234,6 +234,11 @@
           "select_at_least_one": "Select at least one work period.",
           "action": "finish registration"
         }
+      },
+      "pending_approval": {
+        "title": "Registration under review",
+        "message": "Registration submitted successfully! Your profile is under review and you will be able to access the app once it is approved.",
+        "ok": "Got it"
       }
     },
     "dashboard": {

+ 5 - 0
src/i18n/locales/es.json

@@ -234,6 +234,11 @@
           "select_at_least_one": "Seleccione al menos un período de trabajo.",
           "action": "finalizar registro"
         }
+      },
+      "pending_approval": {
+        "title": "Registro en revisión",
+        "message": "¡Registro enviado con éxito! Tu perfil está en revisión y podrás acceder a la app en cuanto sea aprobado.",
+        "ok": "Entendido"
       }
     },
     "dashboard": {

+ 5 - 0
src/i18n/locales/pt.json

@@ -234,6 +234,11 @@
             "select_at_least_one": "Selecione ao menos um período de trabalho.",
             "action": "concluir cadastro"
         }
+      },
+      "pending_approval": {
+        "title": "Cadastro em análise",
+        "message": "Cadastro enviado com sucesso! Seu perfil está em análise e você poderá acessar o app assim que for aprovado.",
+        "ok": "Entendi"
       }
     },
     "dashboard": {

+ 18 - 3
src/pages/LoginPage.vue

@@ -287,12 +287,27 @@ const registerUserAndProvider = async () => {
   append('recipient_default_bank_account[holder_type]', 'individual');
 
   const response = await createUserAndProvider(form);
-  if (response.status === 200) {
-    await setAuthDataFromPayload(response.data.payload);
-    router.push({ name: 'DashboardPage' });
+  if (response.status === 201 || response.status === 200) {
+    $q.dialog({
+      title: t('provider.login.pending_approval.title'),
+      message: response?.data?.message ?? t('provider.login.pending_approval.message'),
+      persistent: true,
+      ok: { rounded: true, color: 'primary-button', label: t('provider.login.pending_approval.ok') },
+    }).onOk(() => {
+      resetFlow();
+    });
   }
 };
 
+const resetFlow = () => {
+  steps.value = 1;
+  isLogin.value = false;
+  showSubStep.value = false;
+  email.value = '';
+  phone.value = '';
+  code.value = '';
+};
+
 const onSubmit = async () => {
   if (showSubStep.value) return; // Não submete o form principal se estiver em um sub-passo