Skip to content

Commit

Permalink
Fix example and mock database
Browse files Browse the repository at this point in the history
And travis build
Related to issue: #7

Signed-off-by: Luiz Guilherme Silva <[email protected]>
  • Loading branch information
luizguilherme5 committed Apr 8, 2017
1 parent d4c66ea commit ab384db
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/Categories/ClinicWorkers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { List, Responsive, SimpleList, Edit, Create, Datagrid, EmailField, EmailInput, TextField, Filter, EditButton, DeleteButton, DisabledInput, LongTextInput, ReferenceInput, SelectInput, SimpleForm, TextInput } from 'admin-on-rest/lib/mui';
import { List, Responsive, SimpleList, Edit, Create, Datagrid, EmailField, TextField, Filter, EditButton, DisabledInput, SimpleForm, TextInput } from 'admin-on-rest/lib/mui';

const UserFilter = props => (
<Filter {...props}>
Expand Down
6 changes: 3 additions & 3 deletions src/Categories/Example.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const PostList = props => (
medium={
<Datagrid>
<TextField source="id" label="ID" />
<ReferenceField label="Usuário" source="userId" reference="users">
<ReferenceField label="Usuário" source="id" reference="user">
<TextField source="name" />
</ReferenceField>
<TextField source="title" label="Título" />
Expand All @@ -44,7 +44,7 @@ export const PostEdit = props => (
<Edit title={<PostTitle />} {...props}>
<SimpleForm>
<DisabledInput source="id" />
<ReferenceInput label="Usuário" source="userId" reference="users">
<ReferenceInput label="Usuário" source="user" reference="user">
<SelectInput optionText="name" />
</ReferenceInput>
<TextInput source="title" />
Expand All @@ -56,7 +56,7 @@ export const PostEdit = props => (
export const PostCreate = props => (
<Create {...props}>
<SimpleForm>
<ReferenceInput label="Usuário" source="userId" reference="users" allowEmpty>
<ReferenceInput label="Usuário" source="id" reference="user" allowEmpty>
<SelectInput optionText="name" />
</ReferenceInput>
<TextInput source="title" label="Título" />
Expand Down
19 changes: 5 additions & 14 deletions src/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,54 +57,47 @@
},
{
"id": 11,
"name": "Testezera Editado",
"email": "edicao_funcionando@gmail.com"
"name": "Teste",
"email": "teste_edicao@gmail.com"
},
{
"id": " ",
"name": "123a",
"email": "1a"
"id": "12",
"name": "Teste Maroto",
"email": "[email protected]"
}
],
"post": [
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
},
{
"userId": 1,
"id": 2,
"title": "qui est esse",
"body": "est rerum tempore vitae\nsequi sint nihil reprehenderit dolor beatae ea dolores neque\nfugiat blanditiis voluptate porro vel nihil molestiae ut reiciendis\nqui aperiam non debitis possimus qui neque nisi nulla"
},
{
"userId": 1,
"id": 3,
"title": "ea molestias quasi exercitationem repellat qui ipsa sit aut",
"body": "et iusto sed quo iure\nvoluptatem occaecati omnis eligendi aut ad\nvoluptatem doloribus vel accusantium quis pariatur\nmolestiae porro eius odio et labore et velit aut"
},
{
"userId": 1,
"id": 4,
"title": "eum et est occaecati",
"body": "ullam et saepe reiciendis voluptatem adipisci\nsit amet autem assumenda provident rerum culpa\nquis hic commodi nesciunt rem tenetur doloremque ipsam iure\nquis sunt voluptatem rerum illo velit"
},
{
"userId": 1,
"id": 5,
"title": "Jogando jogos",
"body": "Antes era KOF agora é SFV"
},
{
"userId": 1,
"id": 6,
"title": "dolorem eum magni eos aperiam quia",
"body": "ut aspernatur corporis harum nihil quis provident sequi\nmollitia nobis aliquid molestiae\nperspiciatis et ea nemo ab reprehenderit accusantium quas\nvoluptate dolores velit et doloremque molestiae"
},
{
"userId": 1,
"id": 7,
"title": "magnam facilis autem",
"body": "dolore placeat quibusdam ea quo vitae\nmagni quis enim qui quis quo nemo aut saepe\nquidem repellat excepturi ut quia\nsunt ut sequi eos ea sed quas"
Expand All @@ -116,13 +109,11 @@
"body": "dignissimos aperiam dolorem qui eum\nfacilis quibusdam animi sint suscipit qui sint possimus cum\nquaerat magni maiores excepturi\nipsam ut commodi dolor voluptatum modi aut vitae"
},
{
"userId": 1,
"id": 9,
"title": "nesciunt iure omnis dolorem tempora et accusantium",
"body": "consectetur animi nesciunt iure dolore\nenim quia ad\nveniam autem ut quam aut nobis\net est aut quod aut provident voluptas autem voluptas"
},
{
"userId": 1,
"id": 10,
"title": "optio molestias id quia eum",
"body": "quo et expedita modi cum officia vel magni\ndoloribus qui repudiandae\nvero nisi sit\nquos veniam quod sed accusamus veritatis error"
Expand Down

0 comments on commit ab384db

Please sign in to comment.