Normalize states to enum values

This commit is contained in:
Alejandro Ruiz 2025-01-21 11:21:04 +01:00
parent db7f9b52d6
commit 40b5960959
1 changed files with 7 additions and 2 deletions

View File

@ -28,10 +28,15 @@ function normalizeStateCounts(data) {
};
}
const { desiredReady, ...rest } = data ;
const states = Object.entries(rest).reduce((res, [key, value]) => {
res[mapStateToEnum(key)] = value;
return res;
}, {});
return {
total: desiredReady,
states: rest,
total: desiredReady,
states,
};
}