mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
receive error when sending message on offline
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user