nuevas listas
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user