upload attachment

This commit is contained in:
Peter Maquiran
2024-08-13 17:05:46 +01:00
parent 251f533a68
commit d7eb6a552b
20 changed files with 436 additions and 152 deletions
@@ -1,13 +1,15 @@
import { z } from "zod";
import { EntityTable } from 'Dexie';
import { zodDataUrlSchema } from "src/app/utils/zod";
export const AttachmentTableSchema = z.object({
id: z.string(),
$id: z.string(),
messageId: z.string(),
file: z.string(),
id: z.string().optional(), // attachment id
$id: z.number().optional(), // local id
$messageId: z.number(),
attachmentId: z.string().optional(),
file: zodDataUrlSchema,
})
export type AttachmentTable = z.infer<typeof AttachmentTableSchema>
export type DexieAttachmentsTableSchema = EntityTable<AttachmentTable, '$id'>;
export const AttachmentTableColumn = '++$id, id, messageId, file'
export const AttachmentTableColumn = '++$id, id, $messageId, messageId, file'