Skip to content

Commit

Permalink
Merge pull request #22 from biancacamargomachado/clean-code
Browse files Browse the repository at this point in the history
Clean code
  • Loading branch information
nilshartmann authored Jun 29, 2021
2 parents e6d5b12 + 7eeff06 commit 61016bc
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 147 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ target/*
/target
npm-debug.log
/bin/
client/*
1 change: 0 additions & 1 deletion client/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ function runDevServer(port, protocol) {
// clearConsole();
console.log(chalk.cyan('Starting the development server...'));
console.log();
// openBrowser(port, protocol);
});
}

Expand Down
66 changes: 1 addition & 65 deletions client/src/components/owners/NewOwnerPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,68 +14,4 @@ const newOwner = (): IOwner => ({
pets: []
});

export default () => <OwnerEditor initialOwner={newOwner()} />;

// export default class NewOwnerPage extends React.Component<void, INewOwnerPageState> {

// context: IRouterContext;

// static contextTypes = {
// router: React.PropTypes.object.isRequired
// };

// constructor() {
// super();
// this.onInputChange = this.onInputChange.bind(this);
// this.onSubmit = this.onSubmit.bind(this);

// this.state = { owner: newOwner() };
// }

// onSubmit(event) {
// event.preventDefault();

// const { owner } = this.state;

// submitForm('/api/owner', owner, (status, response) => {
// if (status === 201) {
// const newOwner = response as IOwner;
// this.context.router.push({
// pathname: '/owners/' + newOwner.id
// });
// } else {
// console.log('ERROR?!...', response);
// this.setState({ error: response });
// }
// });
// }

// onInputChange(name: string, value: string) {
// const { owner } = this.state;
// const modifiedOwner = Object.assign({}, owner, { [name]: value });
// this.setState({ owner: modifiedOwner });
// }

// render() {
// const { owner, error } = this.state;
// return (
// <span>
// <h2>New Owner</h2>
// <form className='form-horizontal' method='POST' action={url('/api/owner')}>
// <div className='form-group has-feedback'>
// <Input object={owner} error={error} label='First Name' name='firstName' onChange={this.onInputChange} />
// <Input object={owner} error={error} label='Last Name' name='lastName' onChange={this.onInputChange} />
// <Input object={owner} error={error} label='Address' name='address' onChange={this.onInputChange} />
// <Input object={owner} error={error} label='City' name='city' onChange={this.onInputChange} />
// <Input object={owner} error={error} label='Telephone' name='telephone' onChange={this.onInputChange} />
// </div>
// <div className='form-group'>
// <div className='col-sm-offset-2 col-sm-10'>
// <button className='btn btn-default' type='submit' onClick={this.onSubmit}>Add Owner</button>
// </div>
// </div>
// </form>
// </span>
// );
// }
// }
export default () => <OwnerEditor initialOwner={newOwner()} />;
73 changes: 0 additions & 73 deletions client/src/middleware/api.ts

This file was deleted.

8 changes: 0 additions & 8 deletions client/tests/__tests__/fetch-mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ fetch.mockResponseOnce = (body, init) => {
);
};

// fetch.mockResponses = (...responses) => {
// responses.forEach(([body, init]) => {
// fetch.mockImplementationOnce(
// () => Promise.resolve(new ResponseWrapper(body, init))
// );
// })
// };

// Default mock is just a empty string.
fetch.mockResponse('');

Expand Down

0 comments on commit 61016bc

Please sign in to comment.