receive error when sending message on offline

This commit is contained in:
Peter Maquiran
2024-08-07 11:18:41 +01:00
parent 95a6d01aae
commit b0a334c9dd
10 changed files with 132 additions and 51 deletions
@@ -9,7 +9,7 @@ import { MessageEntity } from '../../../domain/entity/message';
const tableSchema = z.object({
$id: z.any().optional(),
$id: z.number().optional(),
id: z.string().optional(),
roomId: z.string().uuid(),
message: z.string(),
@@ -117,7 +117,7 @@ export class MessageLocalDataSourceService {
try {
const result = await messageDataSource.message.add(data)
this.messageSubject.next({roomId: data.roomId});
return ok(result as string)
return ok(result as number)
} catch (e) {
return err(false)
}
@@ -136,7 +136,7 @@ export class MessageLocalDataSourceService {
try {
const result = await messageDataSource.message.add(data)
this.messageSubject.next({roomId: data.roomId});
return ok(result as string)
return ok(result)
} catch (e) {
return err(false)
}
@@ -179,11 +179,11 @@ export class MessageLocalDataSourceService {
}
// not used
async updateByMessageId(data: TableMessage ) {
try {
console.log('update sdfsdfsd')
const result = await messageDataSource.message.update(data.id, data)
const result = await messageDataSource.message.update(data.id as any, data)
return ok(result)
} catch (e) {
return err(false)