mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
add contacts
This commit is contained in:
+3
-6
@@ -7,6 +7,7 @@ import { Observable } from 'rxjs';
|
||||
import { RoomOutPutDTO } from '../../dto/room/roomOutputDTO';
|
||||
import { z } from 'zod';
|
||||
import { MessageInputDTO } from '../../dto/message/messageInputDtO';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
|
||||
|
||||
const tableSchema = z.object({
|
||||
@@ -51,7 +52,6 @@ export class MessageLocalDataSourceService {
|
||||
async createMessage(data: MessageInputDTO) {
|
||||
|
||||
try {
|
||||
console.log('add', data)
|
||||
const result = await messageDataSource.message.add(data)
|
||||
return ok(result as string)
|
||||
} catch (e) {
|
||||
@@ -65,7 +65,6 @@ export class MessageLocalDataSourceService {
|
||||
async update(data: TableMessage) {
|
||||
|
||||
try {
|
||||
console.log('update', data)
|
||||
const result = await messageDataSource.message.update(data.id, data)
|
||||
return ok(result)
|
||||
} catch (e) {
|
||||
@@ -78,8 +77,6 @@ export class MessageLocalDataSourceService {
|
||||
async findOrUpdate(data: TableMessage) {
|
||||
const findResult = await this.findMessageById(data.messageId)
|
||||
|
||||
console.log('findOrUpdate', findResult)
|
||||
|
||||
if(findResult.isOk()) {
|
||||
return this.update({...findResult.value, ...data})
|
||||
} else {
|
||||
@@ -87,8 +84,8 @@ export class MessageLocalDataSourceService {
|
||||
}
|
||||
}
|
||||
|
||||
getItemsLive(roomId: string): Observable<RoomListOutPutDTO> {
|
||||
return liveQuery(() => messageDataSource.message.where('roomId').equals(roomId).toArray() as any) as any
|
||||
getItemsLive(roomId: string) {
|
||||
return liveQuery(() => messageDataSource.message.where('roomId').equals(roomId).toArray() )
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user