nuevas listas

This commit is contained in:
2023-03-09 12:53:52 +01:00
parent a6dc62496e
commit 2b6a40f795
5 changed files with 45 additions and 4 deletions

View File

@@ -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();
});