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 @@
import { schema } from "./schema";
export const MuseumShow = (props: ShowProps) => (
const MuseumShow = (props: ShowProps) => (
<Show {...props}>
<SimpleShowLayout>
<TextField source="id" />
......@@ -63,7 +63,7 @@
</List>
);
export const CityList = (props: ListProps) => (
const CityList = (props: ListProps) => (
<List {...props}>
<Datagrid rowClick="show">
<TextField source="id" />
......@@ -73,9 +73,9 @@
</List>
);
export const CityShow = (props: ShowProps) => (
const CityShow = (props: ShowProps) => (
<Show {...props}>
<SimpleShowLayout>
<TextField source="id" />
<TextField source="name" />
<NumberField source="zip_code" />
......@@ -77,7 +77,11 @@
<Show {...props}>
<SimpleShowLayout>
<TextField source="id" />
<TextField source="name" />
<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">
......@@ -83,5 +87,5 @@
<Datagrid rowClick="show">
<TextField source="name"/>
<TextField source="name" />
</Datagrid>
</ReferenceArrayField>
</SimpleShowLayout>
......
......@@ -89,7 +89,9 @@
// Getting subject relations
const subjectRelations = Object.fromEntries(
Object.entries(schema.relationships).filter(
Object.entries(
schema.relationships
).filter(
([_relationName, definition]: [string, S["relationships"][string]]) =>
definition.subject.includes(resource)
)
......@@ -105,7 +107,9 @@
// Getting object relations
const objectRelations = Object.fromEntries(
Object.entries(schema.relationships).filter(
Object.entries(
schema.relationships
).filter(
([_relationName, definition]: [string, S["relationships"][string]]) =>
definition.object.includes(resource)
)
......@@ -132,7 +136,7 @@
restrictions.push(`X ${key} ${variable}`);
});
const result = await rqlClient.queryRows(
`Any ${selection.join(",")} Where ${restrictions.join(",")}, X eid IN (${
params.ids.join(",")
})`
`Any ${selection.join(",")} Where ${restrictions.join(
","
)}, X eid IN (${params.ids.join(",")})`
);
......@@ -138,11 +142,13 @@
);
const entities = result.map((row, rowIdx) => row.reduce(
(agg, attributeValue, idx) => ({
[attributesNames[idx]]: attributeValue,
...agg,
}),
{ id: params.ids[rowIdx] }
));
const entities = result.map((row, rowIdx) =>
row.reduce(
(agg, attributeValue, idx) => ({
[attributesNames[idx]]: attributeValue,
...agg,
}),
{ id: params.ids[rowIdx] }
)
);
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