Sfoglia il codice sorgente

Merge branch 'feature/DIARIA-gus-bloqueio-logins' of Softpar/sfp_front_vue_diarista_prestador into development

zntt 1 mese fa
parent
commit
40ce7c55aa

+ 3 - 3
src/api/user.js

@@ -30,13 +30,13 @@ export const userTypes = async () => {
   return data.payload;
 };
 
-export const sendCode = async (email, phone, type = 'PROVIDER') => {
-  const data = await api.post("/user-send-code", { email, phone, type });
+export const sendCode = async (email, phone) => {
+  const data = await api.post("/provider-send-code", { email, phone });
   return data;
 }
 
 export const validateCode = async (email, phone, code, isLogin = false) => {
-  const data = await api.post("/user-validate-code", { email, phone, code, isLogin });
+  const data = await api.post("/validate-code-provider", { email, phone, code, isLogin });
   return data;
 }
 

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

@@ -221,6 +221,10 @@
           "select_at_least_one": "Select at least one work period.",
           "action": "finish registration"
         }
+      },
+      "pending_approval": {
+        "title": "Registration submitted!",
+        "description": "Your registration is awaiting approval. Once reviewed, you will be able to access the app."
       }
     },
     "dashboard": {

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

@@ -221,6 +221,10 @@
           "select_at_least_one": "Seleccione al menos un período de trabajo.",
           "action": "finalizar registro"
         }
+      },
+      "pending_approval": {
+        "title": "¡Registro enviado!",
+        "description": "Su registro está pendiente de aprobación. Una vez revisado, podrá acceder a la aplicación."
       }
     },
     "dashboard": {

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

@@ -221,6 +221,10 @@
           "select_at_least_one": "Selecione ao menos um período de trabalho.",
           "action": "concluir cadastro"
         }
+      },
+      "pending_approval": {
+        "title": "Cadastro enviado!",
+        "description": "Seu cadastro está aguardando aprovação. Assim que for revisado, você poderá acessar o aplicativo."
       }
     },
     "dashboard": {

+ 8 - 4
src/pages/LoginPage.vue

@@ -33,9 +33,15 @@
             />
             <LoginStepFivePanel v-else-if="steps === 5" v-model="stepFiveForm" />
             <LoginStepSixPanel v-else-if="steps === 6" v-model="stepSixForm" />
+
+            <div v-else-if="steps === 7" class="column items-center justify-center q-gutter-md text-center">
+              <q-icon name="mdi-clock-outline" size="64px" color="warning" />
+              <div class="text-h6 text-text">{{ $t('provider.login.pending_approval.title') }}</div>
+              <div class="text-body2 text-grey-5">{{ $t('provider.login.pending_approval.description') }}</div>
+            </div>
           </div>
 
-          <div v-if="!showSubStep" class="flow-footer">
+          <div v-if="!showSubStep && steps !== 7" class="flow-footer">
             <q-btn
               color="primary-button"
               :label="actionLabel"
@@ -245,13 +251,11 @@ const registerUserAndProvider = async () => {
 
     working_days: workingDays,
 
-    is_approved: false,
   };
 
   const response = await createUserAndProvider(payload);
   if (response.status === 200) {
-    await setAuthDataFromPayload(response.data.payload);
-    router.push({ name: 'DashboardPage' });
+    steps.value = 7;
   }
 };