From 9cb974c61925fe3bb1283c179a421e3e97ccdd4b Mon Sep 17 00:00:00 2001 From: Aaron Carlino Date: Tue, 27 Mar 2018 17:09:10 +1300 Subject: [PATCH] Fix several mistakes in example code --- .../07_ReactJS_Redux_and_GraphQL.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/07_ReactJS_Redux_and_GraphQL.md b/docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/07_ReactJS_Redux_and_GraphQL.md index 549590202..9427cdffc 100644 --- a/docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/07_ReactJS_Redux_and_GraphQL.md +++ b/docs/en/02_Developer_Guides/15_Customising_the_Admin_Interface/07_ReactJS_Redux_and_GraphQL.md @@ -872,14 +872,14 @@ First, let's break up the list into smaller components. import React from 'react'; import { inject } from 'lib/Injector'; -const NotesList = ({ notes, ItemComponent }) => ( +const NotesList = ({ notes = [], ItemComponent }) => ( ); export default inject( - ['NotesListItem'] + ['NotesListItem'], (NotesListItem) => ({ ItemComponent: NotesListItem }) @@ -915,6 +915,7 @@ const query = { templateName: READ, pluralName: 'Notes', pagination: false, + params: {}, fields: [ 'Content', 'ID' @@ -1182,6 +1183,7 @@ const mutation = { templateName: CREATE, singularName: 'Note', pagination: false, + params: {}, fields: [ 'Content', 'ID' @@ -1288,13 +1290,13 @@ Now we just need to register these transforms, and we're done! ```js //... import transformAddForm from './transformAddForm'; -import transformCreateNote from './transformReadNotes'; +import transformCreateNote from './transformCreateNote'; Injector.transform( 'noteslist-query-extension', (updater) => { //... - updater.component('NotesAddForm', transformAddForm); + updater.component('NoteAddForm', transformAddForm); updater.query('CreateNote', transformCreateNote); }, { after: ['noteslist-graphql', 'notesaddform-graphql'] }