nuevas listas
This commit is contained in:
@@ -1,4 +1,15 @@
|
||||
<template>
|
||||
<div class="flex q-ma-md">
|
||||
<q-btn
|
||||
round
|
||||
color="deep-orange"
|
||||
icon="keyboard_return"
|
||||
@click="
|
||||
cargarDatos();
|
||||
$router.push('/');
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<q-page class="flex flex-center">
|
||||
<div class="column q-pa-md q-gutter-sm">
|
||||
<div class="row flex-center q-pb-md">
|
||||
|
||||
@@ -1,9 +1,21 @@
|
||||
<template>
|
||||
<div class="flex flex-center bg-teal-7 q-ma-md" @click="irPerfil()">
|
||||
<div
|
||||
class="flex flex-center bg-teal-7 q-ma-md cursor-pointer"
|
||||
@click="irPerfil()"
|
||||
>
|
||||
<h1 style="font-weight: 415">
|
||||
{{ listaStore.pb.authStore.model.username }}
|
||||
</h1>
|
||||
</div>
|
||||
<div class="flex flex-center">
|
||||
<q-btn
|
||||
outline
|
||||
rounded
|
||||
color="primary"
|
||||
label="Nueva Lista"
|
||||
@click="crearLista()"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex flex-center q-pt-xl q-mt-xl">
|
||||
<div
|
||||
class="full-width text-center q-px-md"
|
||||
@@ -35,6 +47,24 @@ const listListas = async () => {
|
||||
const irPerfil = () => {
|
||||
$router.push("perfil");
|
||||
};
|
||||
|
||||
const crearLista = () => {
|
||||
const data = {
|
||||
nombre: "test3",
|
||||
usuarios: [listaStore.pb.authStore.model.id],
|
||||
items: [],
|
||||
};
|
||||
|
||||
listaStore.pb
|
||||
.collection("lista")
|
||||
.create(data)
|
||||
.then((r) => {
|
||||
console.log("creada");
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
listListas();
|
||||
});
|
||||
|
||||
@@ -25,7 +25,6 @@ export const useListaStore = defineStore("lista", () => {
|
||||
});
|
||||
}
|
||||
async function register(data) {
|
||||
console.log(data);
|
||||
return await pb
|
||||
.collection("users")
|
||||
.create(data)
|
||||
|
||||
Reference in New Issue
Block a user