mirror of
https://github.com/He4eT/simple-spaceapi.git
synced 2026-05-05 01:47:24 +00:00
SpaceAPI: sensors: radiation: required fields
This commit is contained in:
parent
182fd4588e
commit
e14842605a
3 changed files with 12 additions and 4 deletions
|
|
@ -67,6 +67,8 @@ export default ({ strapi }: { strapi: Core.Strapi }) => ({
|
|||
result.logo = absoluteURL(origin)(hackspace?.logo.url);
|
||||
result.url = hackspace.url;
|
||||
|
||||
/* */
|
||||
|
||||
if (!isEmpty(hackspace.location)) {
|
||||
result.location = pickFields([
|
||||
'address',
|
||||
|
|
@ -84,12 +86,16 @@ export default ({ strapi }: { strapi: Core.Strapi }) => ({
|
|||
}
|
||||
}
|
||||
|
||||
/* */
|
||||
|
||||
if (!isEmpty(hackspace.spacefed)) {
|
||||
result.spacefed = pickFields(['spacenet', 'spacesaml'])(
|
||||
hackspace.spacefed,
|
||||
);
|
||||
}
|
||||
|
||||
/* */
|
||||
|
||||
if (!isEmpty(hackspace.cam)) {
|
||||
result.cam = hackspace.cam.map(({ url }) => url);
|
||||
}
|
||||
|
|
@ -217,7 +223,7 @@ export default ({ strapi }: { strapi: Core.Strapi }) => ({
|
|||
'api::radiation-sensor.radiation-sensor',
|
||||
);
|
||||
|
||||
const draft = Object.fromEntries(
|
||||
const typedSensors = Object.fromEntries(
|
||||
types.map((type) => [
|
||||
type,
|
||||
sensors
|
||||
|
|
@ -237,7 +243,7 @@ export default ({ strapi }: { strapi: Core.Strapi }) => ({
|
|||
]),
|
||||
);
|
||||
|
||||
return pickFields(types)(draft);
|
||||
return pickFields(types)(typedSensors);
|
||||
})(),
|
||||
humidity: (
|
||||
await getSensors('api::humidity-sensor.humidity-sensor', [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue