Avisos registro

This commit is contained in:
2023-03-01 13:18:30 +01:00
parent dc6c9ae938
commit 45e2a28412
3 changed files with 33 additions and 12 deletions

View File

@@ -103,10 +103,16 @@
<script setup>
import { ref, computed } from "vue";
import { useListaStore } from "../stores/lista.js";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
const listaStore = useListaStore();
const $q = useQuasar();
const $router = useRouter();
const email = ref("");
const password = ref("");
const username = ref(""); //No exista en la bd, tamaño mínimo
const username = ref("");
const confirmpassword = ref("");
const nombre = ref("");
const usuarios = ref([]);
@@ -115,6 +121,7 @@ const recibeDatos = () => {
listaStore.getUsers().then(function (item) {
usuarios.value = item;
});
console.log(usuarios.value);
};
const comprobarUsername = computed(() => {
let filtro = usuarios.value?.filter(
@@ -170,7 +177,14 @@ const registrar = () => {
passwordConfirm: confirmpassword.value,
name: nombre.value,
};
listaStore.register(data);
listaStore.register(data).then((r) => {
$q.dialog({
title: "Aviso",
message: "Se le ha enviado un correo electrónico que debe verificar",
}).onOk(() => {
$router.push("/");
});
});
};
</script>