Try to remove as many as as possible (#6200)

* Try to remove as many ` as ` as possible

* Fix imports
This commit is contained in:
Daniel Espino García
2022-05-12 15:46:11 +02:00
committed by GitHub
parent f62dcd42f7
commit 75d1c9d228
101 changed files with 298 additions and 302 deletions

View File

@@ -21,11 +21,11 @@ const {INFO, GLOBAL} = MM_TABLES.APP;
*/
export const transformInfoRecord = ({action, database, value}: TransformerArgs): Promise<Model> => {
const raw = value.raw as AppInfo;
const record = value.record as InfoModel;
const record = value.record as InfoModel | undefined;
const isCreateAction = action === OperationType.CREATE;
const fieldsMapper = (app: InfoModel) => {
app._raw.id = isCreateAction ? app.id : record.id;
app._raw.id = isCreateAction ? app.id : record?.id ?? app.id;
app.buildNumber = raw?.build_number;
app.createdAt = raw?.created_at;
app.versionNumber = raw?.version_number;