mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
replicate to mobile
This commit is contained in:
@@ -6,6 +6,6 @@ export const BoldTableSchema = z.object({
|
||||
bold: z.number()
|
||||
})
|
||||
|
||||
export type BoldTable = z.infer<typeof BoldTableSchema>
|
||||
export type BoldTable = z.infer<typeof BoldTableSchema>;
|
||||
export type DexieBoldTable = EntityTable<BoldTable, 'roomId'>;
|
||||
export const BoldTableColumn = 'roomId, bold'
|
||||
export const BoldTableColumn = 'roomId, bold';
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { EntityTable } from 'Dexie';
|
||||
import { z } from 'zod';
|
||||
|
||||
export const UserPhotoTableSchema = z.object({
|
||||
wxUserId: z.string(),
|
||||
blob: z.instanceof(Blob),
|
||||
attachmentId: z.string()
|
||||
})
|
||||
|
||||
export type UserPhotoTable = z.infer<typeof UserPhotoTableSchema>
|
||||
export type DexieUserPhotoTable = EntityTable<UserPhotoTable, 'wxUserId'>;
|
||||
export const UserPhotoTableColumn = 'wxUserId'
|
||||
@@ -8,6 +8,7 @@ import { MessageEntity } from 'src/app/core/chat/entity/message';
|
||||
import { AttachmentTableColumn, DexieAttachmentsTableSchema } from 'src/app/infra/database/dexie/instance/chat/schema/attachment';
|
||||
import { DexieDistributionTable, DistributionTable, DistributionTableColumn } from './instance/chat/schema/destribution';
|
||||
import { BoldTableColumn, DexieBoldTable } from './instance/chat/schema/bold';
|
||||
import { DexieUserPhotoTable, UserPhotoTable, UserPhotoTableColumn } from './instance/chat/schema/user-foto';
|
||||
// import FDBFactory from 'fake-indexeddb/lib/FDBFactory';
|
||||
// import FDBKeyRange from 'fake-indexeddb/lib/FDBKeyRange';
|
||||
|
||||
@@ -23,7 +24,8 @@ export const chatDatabase = new Dexie('chat-database-v1',{
|
||||
typing: DexieTypingsTable,
|
||||
attachment: DexieAttachmentsTableSchema,
|
||||
distribution: DexieDistributionTable,
|
||||
bold: DexieBoldTable
|
||||
bold: DexieBoldTable,
|
||||
userPhoto: DexieUserPhotoTable
|
||||
};
|
||||
|
||||
chatDatabase.version(1).stores({
|
||||
@@ -33,7 +35,8 @@ chatDatabase.version(1).stores({
|
||||
typing: TypingTableColumn,
|
||||
attachment: AttachmentTableColumn,
|
||||
distribution: DistributionTableColumn,
|
||||
bold:BoldTableColumn
|
||||
bold:BoldTableColumn,
|
||||
userPhotoTable: UserPhotoTableColumn
|
||||
});
|
||||
|
||||
chatDatabase.message.mapToClass(MessageEntity)
|
||||
|
||||
Reference in New Issue
Block a user