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

feat: Add forms for City

parent c13c029edf85
No related branches found
No related tags found
1 merge request!15Topic/default/default values
...@@ -114,6 +114,32 @@ ...@@ -114,6 +114,32 @@
</List> </List>
); );
const CityEdit = (props: ListProps) => {
const inputProps = formHelpers["City"].getInputProps;
return (
<Edit {...props}>
<SimpleForm>
<TextInput {...inputProps("name")} />
<NumberInput {...inputProps("zip_code")} />
<TextInput {...inputProps("country")} />
</SimpleForm>
</Edit>
);
};
const CityCreate = (props: ListProps) => {
const inputProps = formHelpers["City"].getInputProps;
return (
<Create {...props}>
<SimpleForm>
<TextInput {...inputProps("name")} />
<NumberInput {...inputProps("zip_code")} />
<TextInput {...inputProps("country")} />
</SimpleForm>
</Create>
);
};
const CityShow = (props: ShowProps) => ( const CityShow = (props: ShowProps) => (
<Show {...props}> <Show {...props}>
<SimpleShowLayout> <SimpleShowLayout>
...@@ -153,7 +179,13 @@ ...@@ -153,7 +179,13 @@
edit={MuseumEdit} edit={MuseumEdit}
create={MuseumCreate} create={MuseumCreate}
/> />
<Resource name="City" list={CityList} show={CityShow} /> <Resource
name="City"
list={CityList}
show={CityShow}
edit={CityEdit}
create={CityCreate}
/>
</Admin> </Admin>
); );
......
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