mirror of
https://github.com/He4eT/simple-spaceapi.git
synced 2026-05-05 01:47:24 +00:00
SpaceAPI: network traffic one more time
This commit is contained in:
parent
88f6be47d2
commit
43425c6b1e
1 changed files with 11 additions and 16 deletions
|
|
@ -380,15 +380,10 @@ export default ({ strapi }: { strapi: Core.Strapi }) => ({
|
||||||
'properties.bits_per_second',
|
'properties.bits_per_second',
|
||||||
'properties.packets_per_second',
|
'properties.packets_per_second',
|
||||||
],
|
],
|
||||||
)).map((sensor: { properties: {
|
)).map((sensor: {properties: {bits_per_second: any, packets_per_second: any}}) => {
|
||||||
bits_per_second: any,
|
|
||||||
packets_per_second: any,
|
|
||||||
} }) => {
|
|
||||||
const { properties, ...rest } = sensor;
|
const { properties, ...rest } = sensor;
|
||||||
|
|
||||||
const cleanProperties = isEmpty(properties)
|
const propertiesEntries = Object.entries(pickFields([
|
||||||
? []
|
|
||||||
: Object.entries(pickFields([
|
|
||||||
'bits_per_second',
|
'bits_per_second',
|
||||||
'packets_per_second',
|
'packets_per_second',
|
||||||
])(properties))
|
])(properties))
|
||||||
|
|
@ -399,9 +394,9 @@ export default ({ strapi }: { strapi: Core.Strapi }) => ({
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...rest,
|
...rest,
|
||||||
...(isEmpty(cleanProperties)
|
...(isEmpty(propertiesEntries)
|
||||||
? {}
|
? {}
|
||||||
: { properties: Object.fromEntries(cleanProperties) }
|
: { properties: Object.fromEntries(propertiesEntries) }
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue