show last messae and date

This commit is contained in:
Peter Maquiran
2024-08-30 15:31:29 +01:00
parent d6a08c6264
commit 3edbcc194e
13 changed files with 160 additions and 36 deletions
@@ -1,6 +1,7 @@
import { z } from "zod";
import { EntityTable } from 'Dexie';
import { RoomType } from "src/app/core/chat/entity/group";
import { MessageEntity, MessageEntitySchema } from "src/app/core/chat/entity/message";
export const RoomTableSchema = z.object({
id: z.string(),
@@ -13,9 +14,10 @@ export const RoomTableSchema = z.object({
}),
createdAt: z.any(),
expirationDate: z.any().nullable(),
roomType: z.nativeEnum(RoomType)
roomType: z.nativeEnum(RoomType),
messages: MessageEntitySchema.array().optional()
})
export type RoomTable = z.infer<typeof RoomTableSchema>
export type DexieRoomsTable = EntityTable<RoomTable, 'id'>;
export const RoomTableColumn = 'id, createdBy, roomName, roomType, expirationDate, lastMessage'
export const RoomTableColumn = 'id, createdBy, roomName, roomType, expirationDate, lastMessage'