Fix add DM screen and some other database related issues (#6144)

* Fix add DM screen and some other database related issues

* Minor style fixes

* Handle create DM/GM websocket by using the teammate ids

* Address feedback
This commit is contained in:
Daniel Espino García
2022-04-09 05:10:08 +02:00
committed by GitHub
parent ee1f8ddab6
commit 26b3fbf87f
32 changed files with 262 additions and 253 deletions

View File

@@ -187,7 +187,7 @@ export default class BaseDataOperator {
* @throws {DataOperatorException}
* @returns {Promise<void>}
*/
batchRecords = async (models: Model[]): Promise<void> => {
async batchRecords(models: Model[]): Promise<void> {
try {
if (models.length > 0) {
await this.database.write(async (writer: WriterInterface) => {
@@ -198,7 +198,7 @@ export default class BaseDataOperator {
// eslint-disable-next-line no-console
console.warn('batchRecords error ', e as Error);
}
};
}
/**
* handleRecords : Utility that processes some records' data against values already present in the database so as to avoid duplicity.
@@ -211,7 +211,7 @@ export default class BaseDataOperator {
* @param {string} handleRecordsArgs.tableName
* @returns {Promise<Model[]>}
*/
handleRecords = async ({buildKeyRecordBy, fieldName, transformer, createOrUpdateRawValues, deleteRawValues = [], tableName, prepareRecordsOnly = true}: HandleRecordsArgs): Promise<Model[]> => {
async handleRecords({buildKeyRecordBy, fieldName, transformer, createOrUpdateRawValues, deleteRawValues = [], tableName, prepareRecordsOnly = true}: HandleRecordsArgs): Promise<Model[]> {
if (!createOrUpdateRawValues.length) {
// eslint-disable-next-line no-console
console.warn(
@@ -242,5 +242,5 @@ export default class BaseDataOperator {
}
return models;
};
}
}