Skip to content

Commit 183e886

Browse files
committed
Changed the metrics model schema to include category
Category is now included on the metrics model so that the saved metrics state can be used directly while creating the rows for the data table in transfer columns component
1 parent 508ed0e commit 183e886

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

chronos_npm_package/controllers/mongo.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,10 @@ mongo.getSavedMetricsLength = async (mode, currentMetricNames) => {
284284
mongo.addMetrics = async (healthMetrics, mode, currentMetricNames) => {
285285
//This function adds only the new metrics from metrics model to the metrics database
286286
const newMets = [];
287-
for (let metric of healthMetrics) {
288-
if (!(metric.metric in currentMetricNames)) {
289-
const name = metric.metric;
290-
newMets.push({ metric: name, mode: mode });
287+
for (let healthMetric of healthMetrics) {
288+
const { metric, category} = healthMetric
289+
if (!(metric in currentMetricNames)) {
290+
newMets.push({ metric, mode,category });
291291
currentMetricNames[metric.metric] = true;
292292
}
293293
};

chronos_npm_package/models/MetricsModel.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ const MetricsSchema = new Schema({
1313
},
1414
mode: {
1515
type: String
16+
},
17+
category: {
18+
type:String
1619
}
1720
});
1821

0 commit comments

Comments
 (0)