-
Notifications
You must be signed in to change notification settings - Fork 0
Created Add_Driver UI [#171205845] #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
| 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); }); | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it require to wrap input into input group all time
| import { Button, InputGroup, Input} from 'reactstrap'; | ||
|
|
||
| function Add_Driver() { | ||
| const [driverFirstName, setDriverFirstName] = useState(''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move component/library imports at top.
Created Add_Driver UI File
Pivotal Id : [#171205845]