add database fields

This commit is contained in:
Peter Maquiran
2024-06-14 09:30:14 +01:00
parent f6dc118fe4
commit 3da412eef6
7 changed files with 49 additions and 389 deletions
@@ -16,6 +16,7 @@ const tableSchema = z.object({
messageType: z.number(),
canEdit: z.boolean(),
oneShot: z.boolean(),
sentAt: z.string().optional(),
requireUnlock: z.boolean(),
sender: z.object({
wxUserId: z.number(),
@@ -49,7 +50,7 @@ export class MessageLocalDataSourceService {
messageDataSource.message.hook('creating', (primKey, obj, trans) => {
// const newMessage = await trans.table('message').get(primKey);
this.messageSubject.next(obj);
this.messageSubject.next(obj);
// return newMessage
})
}
@@ -103,8 +104,8 @@ export class MessageLocalDataSourceService {
}
}
getItemsLive(roomId: string) {
return liveQuery(() =>
getItemsLive(roomId: string) {
return liveQuery(() =>
messageDataSource.message.where('roomId').equals(roomId).sortBy('id')
)
}