Skip to content

Commit 880c6ad

Browse files
committed
chore: Auto-format JavaScript files with Prettier
1 parent a0df544 commit 880c6ad

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

core/database/foxx/api/metrics_router.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ router
5353
description: "Update message metrics",
5454
extra: obj,
5555
});
56-
5756
} catch (e) {
5857
logger.logRequestFailure({
5958
client: client?._id,
@@ -63,7 +62,7 @@ router
6362
status: "Failure",
6463
description: "Update message metrics",
6564
extra: obj,
66-
error: e
65+
error: e,
6766
});
6867
g_lib.handleException(e, res);
6968
}
@@ -120,7 +119,6 @@ router
120119
description: "Update message metrics",
121120
extra: result,
122121
});
123-
124122
} catch (e) {
125123
logger.logRequestFailure({
126124
client: client?._id,
@@ -147,7 +145,9 @@ router
147145

148146
router
149147
.get("/users/active", function (req, res) {
150-
const client = req.queryParams.client ? g_lib.getUserFromClientID(req.queryParams.client) : null;
148+
const client = req.queryParams.client
149+
? g_lib.getUserFromClientID(req.queryParams.client)
150+
: null;
151151
try {
152152
logger.logRequestStarted({
153153
client: client?._id,
@@ -188,9 +188,8 @@ router
188188
routePath: basePath + "/users/active",
189189
status: "Success",
190190
description: "Get recently active users from metrics",
191-
extra: cnt
191+
extra: cnt,
192192
});
193-
194193
} catch (e) {
195194
logger.logRequestFailure({
196195
client: client?._id,
@@ -200,7 +199,7 @@ router
200199
status: "Failure",
201200
description: "Get recently active users from metrics",
202201
extra: cnt,
203-
error: e
202+
error: e,
204203
});
205204

206205
g_lib.handleException(e, res);
@@ -245,7 +244,6 @@ router
245244
description: "Purge older metrics",
246245
extra: "undefined",
247246
});
248-
249247
} catch (e) {
250248
logger.logRequestFailure({
251249
client: client?._id,
@@ -254,7 +252,7 @@ router
254252
routePath: basePath + "/purge",
255253
status: "Failure",
256254
description: "Purge older metrics",
257-
extra: "undefined",
255+
extra: "undefined",
258256
error: e,
259257
});
260258
g_lib.handleException(e, res);

core/database/foxx/tests/metrics_router.test.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ const metrics_base_url = `${baseUrl}/metrics`;
1010

1111
describe("unit_metrics_router: /users/active endpoint", () => {
1212
after(function () {
13-
const collections = ["metrics"];
14-
collections.forEach((name) => {
15-
let col = db._collection(name);
16-
if (col) col.truncate();
13+
const collections = ["metrics"];
14+
collections.forEach((name) => {
15+
let col = db._collection(name);
16+
if (col) col.truncate();
17+
});
1718
});
18-
});
1919
beforeEach(() => {
2020
const collections = ["metrics"];
2121
collections.forEach((name) => {
@@ -94,4 +94,3 @@ describe("unit_metrics_router: /users/active endpoint", () => {
9494
expect(body).to.deep.equal({});
9595
});
9696
});
97-

0 commit comments

Comments
 (0)