Bug presenting chat rooms

This commit is contained in:
Eudes Inácio
2021-12-18 16:58:53 +01:00
parent 3b07461376
commit af84d4ed6e
2 changed files with 182 additions and 18 deletions
+5 -3
View File
@@ -140,7 +140,9 @@ export class SqliteService {
Uids Text,
Usernames Text,
LastMessage Text,
UpdatedAt varchar(255)
UpdatedAt varchar(255),
customFields Text,
name varchar(255)
)`, [])
.then((res) => {
console.log("Sucess chat list room Table created: ", res)
@@ -248,8 +250,8 @@ export class SqliteService {
public addChatListRoom(data) {
console.log('INSIDE DB CHAT LIST ROOM',data,)
this.dbInstance.executeSql(`
INSERT OR REPLACE INTO ${this.chatlistroom} (Id,Uids,Usernames,LastMessage,UpdatedAt)
VALUES ('${data.id}','${JSON.stringify(data.uids)}','${JSON.stringify(data.usernames)}','${JSON.stringify(data.lastMessage)}','${data.updatedat}')`, [])
INSERT OR REPLACE INTO ${this.chatlistroom} (Id,Uids,Usernames,LastMessage,UpdatedAt,customFields,name)
VALUES ('${data.id}','${JSON.stringify(data.uids)}','${JSON.stringify(data.usernames)}','${JSON.stringify(data.lastMessage)}','${data.updatedat}','${JSON.stringify(data.customFields)}','${data.name}')`, [])
.then(() => {
console.log("chat room add with Success");