mirror of
https://github.com/He4eT/simple-spaceapi.git
synced 2026-05-05 01:47:24 +00:00
SpaceAPI: people now present
This commit is contained in:
parent
81eee3f638
commit
c807bf8827
1 changed files with 9 additions and 2 deletions
|
|
@ -352,7 +352,7 @@ export default ({ strapi }: { strapi: Core.Strapi }) => ({
|
|||
],
|
||||
);
|
||||
|
||||
const peopleNowPresentSensors = await getSensors(
|
||||
const peopleNowPresentSensors = (await getSensors(
|
||||
'api::people-now-present-sensor.people-now-present-sensor',
|
||||
[
|
||||
'value',
|
||||
|
|
@ -365,7 +365,14 @@ export default ({ strapi }: { strapi: Core.Strapi }) => ({
|
|||
[
|
||||
'names',
|
||||
],
|
||||
);
|
||||
)).map((sensor: {names: Array<any>}) => {
|
||||
if (!isEmpty(sensor.names)) {
|
||||
sensor.names = sensor.names.map((x) => x['name']);
|
||||
} else {
|
||||
delete sensor.names;
|
||||
}
|
||||
return sensor
|
||||
});
|
||||
|
||||
const networkTrafficSensors = (await getSensors(
|
||||
'api::network-traffic-sensor.network-traffic-sensor',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue