chats
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user