Open
Conversation
Comment on lines
+24
to
+32
| fetch('http://localhost:4000/users', { | ||
| method: 'POST', | ||
| headers: { | ||
| Accept: 'application/cab-tab.com; version=1', | ||
| 'Content-Type': 'application/json', | ||
| }, | ||
| body: JSON.stringify(user), | ||
| }).then((response) => { console.log(response); }); | ||
| }; |
Collaborator
There was a problem hiding this comment.
There should generic handler for api calling, ApiHelper which would contain wrapper over fetch.
Please remover log if its not logged purposefully
| <br /> | ||
|
|
||
| <div className="row"> | ||
| <InputGroup className="col-sm-12"> |
Collaborator
There was a problem hiding this comment.
Does it require to wrap input into input group all time
| import { Button, InputGroup, Input} from 'reactstrap'; | ||
|
|
||
| function Add_Driver() { | ||
| const [driverFirstName, setDriverFirstName] = useState(''); |
Collaborator
There was a problem hiding this comment.
Can we make it one object say driverDetailObject and add generic handler.
src/components/Add_Driver.js
Outdated
| import React, { useState } from 'react'; | ||
| import 'bootstrap/dist/css/bootstrap.min.css'; | ||
| import './component.css'; | ||
| import { Button, InputGroup, Input} from 'reactstrap'; |
Collaborator
There was a problem hiding this comment.
move component/library imports at top.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Created Add_Driver UI File
Pivotal Id : [#171205845]