2017-12-18 6 views
1

誰かがこれを手伝ってくれることを願っています。 タイトル、メッセージ、およびユーザーIDの配列(特定の通知用)を持つ通知を作成したいとします。この機能を実現するためにReferenceArrayInputSelectArrayInputを使用しますが、期待どおりに機能しません。 Notifications/create.jsxReferenceArrayInputとSelectArrayInputが期待どおりに機能しない

<Create title="Crear notificación" {...this.props}> 
    <SimpleForm> 
     <TextInput source="title" label="Título"/> 
     <TextInput source="message" label="Mensaje" /> 
     <ReferenceArrayInput source="recipients" reference="users" label="Usuarios"> 
      <SelectArrayInput optionText='firstName'/> 
     </ReferenceArrayInput> 
     </SimpleForm> 
</Create> 

App.jsx

<Admin authClient={authClient(feathersClient, authClientOptions)} 
     restClient={restClient(feathersClient, options)}> 
     <Resource name="users" list={UserList} options={{label: 'Usuarios'}} icon={UsersIcon}/> 
     <Resource name="notifications" list={NotificationsList} create={NotificationsCreate} options={{label: 'Notificaciones'}} icon={NotificationIcon}/> 
</Admin> 

レンダリングされた入力をクリックすると、それが正しくユーザーを取得しますが、ユーザーがクリックしたときに、それがチップをプッシュしていません入力。 サーバーからのユーザー配列が正しい場合、ユーザーを選択したときに受信者の配列に追加されない理由はわかりません。ここで

は私のpackage.jsonプロジェクト

{ 
    "name": "gmx-web", 
    "version": "0.1.0", 
    "private": true, 
    "dependencies": { 
    "admin-on-rest": "^1.3.2", 
    "aor-feathers-client": "^0.7.1", 
    "feathers-client": "^2.4.0", 
    "react": "^16.2.0", 
    "react-dom": "^16.2.0", 
    "react-scripts": "1.0.17" 
    }, 
    "scripts": { 
    "start": "react-scripts start", 
    "build": "react-scripts build", 
    "test": "react-scripts test --env=jsdom", 
    "eject": "react-scripts eject" 
    } 
} 

答えて

0

あなたはCreateコンポーネントであるとしてに関する追加の知識については、あなたがReferenceArrayInputからallowEmpty小道具を追加してみているのですか?

+0

はい、私はここに入れなかったのですが、 'allowEmpty'は私の' ReferenceArrayInput'にありますが、まだ動作しません。 –

+0

残りのユーザGET要求を投稿できますか? – Gildas

関連する問題