fix(logs): handle log message nested extra properties (#2459)

pull/2454/head^2
Danshil Kokil Mungur 3 years ago committed by GitHub
parent b5bd6ee78f
commit d7779408d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,7 +1,7 @@
import { Router } from 'express';
import rateLimit from 'express-rate-limit';
import fs from 'fs';
import { merge, omit, sortBy } from 'lodash';
import { merge, omit, set, sortBy } from 'lodash';
import { rescheduleJob } from 'node-schedule';
import path from 'path';
import { getRepository } from 'typeorm';
@ -349,11 +349,7 @@ settingsRoutes.get(
Object.keys(logMessage)
.filter((prop) => !logMessageProperties.includes(prop))
.forEach((prop) => {
Object.assign(logMessage, {
data: {
[prop]: logMessage[prop],
},
});
set(logMessage, `data.${prop}`, logMessage[prop]);
});
}

Loading…
Cancel
Save