diff --git a/packages/demo/src/App.tsx b/packages/demo/src/App.tsx index 70c03510bc065bf65711916c16d4fa87b5683af9_cGFja2FnZXMvZGVtby9zcmMvQXBwLnRzeA==..5f7a610e60d5c9087adf9d2f8d110681c9f585b5_cGFja2FnZXMvZGVtby9zcmMvQXBwLnRzeA== 100644 --- a/packages/demo/src/App.tsx +++ b/packages/demo/src/App.tsx @@ -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> diff --git a/packages/ra-cubicweb/src/index.ts b/packages/ra-cubicweb/src/index.ts index 70c03510bc065bf65711916c16d4fa87b5683af9_cGFja2FnZXMvcmEtY3ViaWN3ZWIvc3JjL2luZGV4LnRz..5f7a610e60d5c9087adf9d2f8d110681c9f585b5_cGFja2FnZXMvcmEtY3ViaWN3ZWIvc3JjL2luZGV4LnRz 100644 --- a/packages/ra-cubicweb/src/index.ts +++ b/packages/ra-cubicweb/src/index.ts @@ -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 }; },