Skip to content
Snippets Groups Projects
Commit 5f7a610e60d5 authored by Frank Bessou's avatar Frank Bessou :spider_web:
Browse files

fix: run prettier

parent 70c03510bc06
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
import { schema } from "./schema"; import { schema } from "./schema";
export const MuseumShow = (props: ShowProps) => ( const MuseumShow = (props: ShowProps) => (
<Show {...props}> <Show {...props}>
<SimpleShowLayout> <SimpleShowLayout>
<TextField source="id" /> <TextField source="id" />
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</List> </List>
); );
export const CityList = (props: ListProps) => ( const CityList = (props: ListProps) => (
<List {...props}> <List {...props}>
<Datagrid rowClick="show"> <Datagrid rowClick="show">
<TextField source="id" /> <TextField source="id" />
...@@ -73,9 +73,9 @@ ...@@ -73,9 +73,9 @@
</List> </List>
); );
export const CityShow = (props: ShowProps) => ( const CityShow = (props: ShowProps) => (
<Show {...props}> <Show {...props}>
<SimpleShowLayout> <SimpleShowLayout>
<TextField source="id" /> <TextField source="id" />
<TextField source="name" /> <TextField source="name" />
<NumberField source="zip_code" /> <NumberField source="zip_code" />
...@@ -77,7 +77,11 @@ ...@@ -77,7 +77,11 @@
<Show {...props}> <Show {...props}>
<SimpleShowLayout> <SimpleShowLayout>
<TextField source="id" /> <TextField source="id" />
<TextField source="name" /> <TextField source="name" />
<NumberField source="zip_code" /> <NumberField source="zip_code" />
<ReferenceArrayField label="Museum" reference="Museum" source="reverse_is_in"> <ReferenceArrayField
label="Museum"
reference="Museum"
source="reverse_is_in"
>
<Datagrid rowClick="show"> <Datagrid rowClick="show">
...@@ -83,5 +87,5 @@ ...@@ -83,5 +87,5 @@
<Datagrid rowClick="show"> <Datagrid rowClick="show">
<TextField source="name"/> <TextField source="name" />
</Datagrid> </Datagrid>
</ReferenceArrayField> </ReferenceArrayField>
</SimpleShowLayout> </SimpleShowLayout>
......
...@@ -89,7 +89,9 @@ ...@@ -89,7 +89,9 @@
// Getting subject relations // Getting subject relations
const subjectRelations = Object.fromEntries( const subjectRelations = Object.fromEntries(
Object.entries(schema.relationships).filter( Object.entries(
schema.relationships
).filter(
([_relationName, definition]: [string, S["relationships"][string]]) => ([_relationName, definition]: [string, S["relationships"][string]]) =>
definition.subject.includes(resource) definition.subject.includes(resource)
) )
...@@ -105,7 +107,9 @@ ...@@ -105,7 +107,9 @@
// Getting object relations // Getting object relations
const objectRelations = Object.fromEntries( const objectRelations = Object.fromEntries(
Object.entries(schema.relationships).filter( Object.entries(
schema.relationships
).filter(
([_relationName, definition]: [string, S["relationships"][string]]) => ([_relationName, definition]: [string, S["relationships"][string]]) =>
definition.object.includes(resource) definition.object.includes(resource)
) )
...@@ -132,7 +136,7 @@ ...@@ -132,7 +136,7 @@
restrictions.push(`X ${key} ${variable}`); restrictions.push(`X ${key} ${variable}`);
}); });
const result = await rqlClient.queryRows( const result = await rqlClient.queryRows(
`Any ${selection.join(",")} Where ${restrictions.join(",")}, X eid IN (${ `Any ${selection.join(",")} Where ${restrictions.join(
params.ids.join(",") ","
})` )}, X eid IN (${params.ids.join(",")})`
); );
...@@ -138,11 +142,13 @@ ...@@ -138,11 +142,13 @@
); );
const entities = result.map((row, rowIdx) => row.reduce( const entities = result.map((row, rowIdx) =>
(agg, attributeValue, idx) => ({ row.reduce(
[attributesNames[idx]]: attributeValue, (agg, attributeValue, idx) => ({
...agg, [attributesNames[idx]]: attributeValue,
}), ...agg,
{ id: params.ids[rowIdx] } }),
)); { id: params.ids[rowIdx] }
)
);
return { data: entities }; return { data: entities };
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment