Download file working

This commit is contained in:
Eudes Inácio
2021-12-23 07:40:01 +01:00
parent cff5ee4322
commit 8c20b62215
7 changed files with 96 additions and 38 deletions
+5 -3
View File
@@ -279,8 +279,8 @@ export class SqliteService {
public addChatMSG(data) {
console.log('INSIDE DB CHAT MSG',data,)
this.dbInstance.executeSql(`
INSERT OR IGNORE INTO ${this.chatmsg} (Id,Attachments,Channels,File,Mentions,Msg,Rid, Ts ,U, UpdatedAt,image_url)
VALUES ('${data._id}','${JSON.stringify(data.attachments)}','${JSON.stringify(data.channels)}','${JSON.stringify(data.file)}','${JSON.stringify(data.mentions)}','${data.msg}','${data.rid}','${data.ts}','${JSON.stringify(data.u)}','${data._updatedAt}','${JSON.stringify(data.image_url)}')`, [])
INSERT OR IGNORE INTO ${this.chatmsg} (Id,Attachments,Channels,File,Mentions,Msg,Rid, Ts ,U, UpdatedAt)
VALUES ('${data._id}','${JSON.stringify(data.attachments)}','${JSON.stringify(data.channels)}','${JSON.stringify(data.file)}','${JSON.stringify(data.mentions)}','${data.msg}','${data.rid}','${data.ts}','${JSON.stringify(data.u)}','${data._updatedAt}')`, [])
.then(() => {
console.log("chat msg add with Success");
@@ -321,10 +321,12 @@ export class SqliteService {
//updateChatMsg
public updateChatMsg(id, data) {
let jsonId = JSON.stringify(id)
let jsondata = JSON.stringify(data)
try {
console.log("update action data", data)
this.dbInstance.executeSql(`
UPDATE ${this.chatmsg} SET image_url = ? WHERE Id = ${id}`, [data])
UPDATE ${this.chatmsg} SET image_url = ? WHERE Id = ${jsonId}`, [jsondata])
.then(() => {
console.log("ChatMsg update with Success");