mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
fix message
This commit is contained in:
@@ -91,7 +91,7 @@ export class GetRoomListUseCaseService {
|
||||
// console.log({roomsToDelete, roomsToInsert, roomsToUpdate})
|
||||
|
||||
// sometime api return duplicated rooms
|
||||
const insertedIds = []
|
||||
const insertedIds: string[] = []
|
||||
|
||||
if(roomsToInsert) {
|
||||
const roomsToInsertEntity = GetRoomListMapper.toDomain(roomsToInsert)
|
||||
@@ -115,7 +115,7 @@ export class GetRoomListUseCaseService {
|
||||
} else {
|
||||
|
||||
// prevent to insert the same room due to server duplication
|
||||
if(!insertedIds.find(e => room.id)) {
|
||||
if(!insertedIds.find(e => room.id == e)) {
|
||||
|
||||
const createResult = this.roomLocalDataSourceService.insert(room)
|
||||
|
||||
@@ -123,9 +123,13 @@ export class GetRoomListUseCaseService {
|
||||
|
||||
createResult.then((result) => {
|
||||
if(result.isErr()) {
|
||||
console.log('error', result.error)
|
||||
console.error('error', result.error)
|
||||
}
|
||||
}).catch(e => {
|
||||
console.error('error on insert', e);
|
||||
})
|
||||
} else {
|
||||
console.error('server duplication', room.id, insertedIds.toString())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user