chats
Deploy app frontend / app frontend (push) Has been cancelled
Deploy db-migrations / db-migrations (push) Successful in 38s

This commit is contained in:
2024-12-06 23:50:51 +02:00
parent cf87c0daa7
commit 51a7f8f354
7 changed files with 124 additions and 16 deletions
@@ -12,11 +12,17 @@
<template #default="{ data }">
<div
v-if="data.rows.length > 0"
class="flex flex-col gap-5 my-4 grid grid-cols-1 sm:grid-cols-3 gap-4"
/>
class="justify-self-start align-baseline-start flex flex-col gap-4"
>
<ChatCard
v-for="{ doc: chatDoc } in data.rows.filter((row) => !!row.doc)"
:key="`${chatDoc!._id}`"
:chatDoc="chatDoc!"
/>
</div>
<div v-else class="place-self-center">
<h1 class="text-2xl font-bold mb-4 text-gray-500">Чаты в разработке</h1>
<h1 class="text-2xl font-bold mb-4 text-gray-500">У вас пока нет чатов</h1>
</div>
</template>
@@ -38,11 +44,19 @@
<script setup lang="ts">
import { useQuery } from '@tanstack/vue-query'
import { chatsDbRemote } from '@/api/dbs'
import { getUserUuid } from '@/utils/getUserUuid'
const query = useQuery({
queryKey: ['qrCodes'],
queryFn: async () => {
return { rows: [] } as const
queryFn: () => {
const user_uuid = getUserUuid()
return chatsDbRemote.allDocs({
startkey: `chat:${user_uuid}:`,
endkey: `chat:${user_uuid}:\uffff`,
limit: Number.MAX_SAFE_INTEGER,
include_docs: true,
})
},
})
</script>