fix(basic.gblib): update ChatServices.ts #420

Closed
eltociear wants to merge 2540 commits from patch-1 into main
Showing only changes of commit a728746d8c - Show all commits

View file

@ -662,21 +662,19 @@ export class SystemKeywords {
public async saveToStorage({ pid, table, fieldsValues, fieldsNames }): Promise<any> { public async saveToStorage({ pid, table, fieldsValues, fieldsNames }): Promise<any> {
const { min } = await DialogKeywords.getProcessInfo(pid); const { min } = await DialogKeywords.getProcessInfo(pid);
GBLog.info(`BASIC: Saving to storage '${table}' (SAVE).`); GBLog.info(`BASIC: Saving to storage '${table}' (SAVE).`);
const minBoot = GBServer.globals.minBoot as any;
const definition = this.getTableFromName(table, min); const definition = this.getTableFromName(table, min);
let dst = {}; let dst = {};
// Uppercases fields.
let i = 0;
Object.keys(fieldsValues).forEach(fieldSrc => {
const field = fieldsNames[i].charAt(0).toUpperCase() + fieldsNames[i].slice(1);
// Uppercases fields. dst[field] = fieldsValues[fieldSrc];
let i = 0;
Object.keys(fieldsValues).forEach(fieldSrc => {
const field = fieldsNames[i].charAt(0).toUpperCase() + fieldsNames[i].slice(1);
dst[field] = fieldsValues[fieldSrc]; i++;
});
i++;
});
let item; let item;
await retry( await retry(
@ -685,6 +683,7 @@ export class SystemKeywords {
}, },
{ {
retries: 5, retries: 5,
onRetry: (err)=>{GBLog.error(`Retrying due to: ${err.message}.`);}
} }
); );
@ -2230,10 +2229,21 @@ export class SystemKeywords {
} }
} }
this.cachedMerge[pid][file].push(row);
if (storage) { if (storage) {
let dst={};
// Uppercases fields.
let i = 0;
Object.keys(fieldsValues).forEach(fieldSrc => {
const field = fieldsNames[i].charAt(0).toUpperCase() + fieldsNames[i].slice(1);
dst[field] = fieldsValues[fieldSrc];
i++;
});
await this.saveToStorage({ pid, table: file, fieldsValues, fieldsNames }); await this.saveToStorage({ pid, table: file, fieldsValues, fieldsNames });
this.cachedMerge[pid][file].push(dst);
} }
else { else {
await this.save({ pid, file, args: fieldsValues }); await this.save({ pid, file, args: fieldsValues });