From 1726a81b320e92ce412c0fa2b2b05f73798cc4ee Mon Sep 17 00:00:00 2001
From: Jules Laplace <julescarbon@gmail.com>
Date: Thu, 29 Jun 2017 03:09:00 +0200
Subject: folder browser

---
 client/components/Folders/FolderForm.jsx | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

(limited to 'client/components/Folders/FolderForm.jsx')

diff --git a/client/components/Folders/FolderForm.jsx b/client/components/Folders/FolderForm.jsx
index 3a3c54e..6068400 100644
--- a/client/components/Folders/FolderForm.jsx
+++ b/client/components/Folders/FolderForm.jsx
@@ -23,23 +23,25 @@ export default class FolderForm extends Component {
   }
   handleSubmit(event) {
     event.preventDefault()
-    client.folders.create( this.state ).then( (data) => {
-      
+    let rec = Object.assign({}, this.state)
+    delete rec.error
+    client.folder.create( rec ).then( (data) => {
+      console.log(data)
     })
   }
   render() {
     return (
-      <div class='folderForm'>
+      <div class='form'>
+        <h1>Create a new folder</h1>
         <div>
-          <h1>Create a new folder</h1>
-          <div>
-            <label for='folders_folder_name'>Folder name</label>
-            <input type='text' id='folders_folder_name' name='name' value={this.state.name} onChange={this.updateState} />
-          </div>
-          <div>
-            <label></label>
-            <button onClick={() => this.create()>Create</button>
-          </div>
+          <label for='folders_folder_name'>Name</label>
+          <input type='text' id='folders_folder_name' name='name' value={this.state.name} onChange={this.updateState} />
+          <label for='folders_folder_description'>Description</label>
+          <textarea id='folders_folder_description' name='description' value={this.state.description} onChange={this.updateState} />
+        </div>
+        <div>
+          <label></label>
+          <button onClick={this.handleSubmit}>Create</button>
         </div>
       </div>
     )
-- 
cgit v1.2.3-70-g09d2

