Skip to content
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

i have many problem with this. see README #4

Open
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

Ethanng329
Copy link

No description provided.

index.js Outdated
orders[index] = req.body;
orders[index]['id'] = index;
orderid++;
res.status(200).json({ OK: 'order completed' });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to return the new object after save with new id

res.json(orders);
});

// app.post('/menu', function(req, res) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out code can be removed

index.js Outdated
res.status(200).json({ OK: 'order completed' });
});

app.get('/api/order', function(req, res) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be better to call the route /api/orders as it returns multiple orders rather than a single order

completeOrder: complete
});

fetch('http://localhost:8080/api/order', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use relative URL here - /api/order. It will also make the CORS issue go away

import Header from './Header';
import Menu from './Menu';
// import Basket from './Basket';
import { METHODS } from 'http';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this import needed?

@@ -1,16 +1,146 @@
import React from 'react';
import Header from './Header';
import Menu from './Menu';
// import Basket from './Basket';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented code can be removed

const currentOrder = Object.assign({}, this.state.currentOrder, newOrder);
this.setState({ currentOrder });
} else if ((this.state.currentOrder[id] = 1)) {
const currentOrder = Object.assign({}, this.state.currentOrder);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

}

handleClick(event) {
// event.preventDefault()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out code can be removed

@@ -0,0 +1,13 @@
import React from 'react';
import { INSPECT_MAX_BYTES } from 'buffer';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this import needed?

@@ -0,0 +1,37 @@
import React from 'react';
import { ENGINE_METHOD_DIGESTS } from 'constants';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this import needed?


// [email protected]

const chunks = email.split('@');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be neat to extrac email validation function into own module. let me know if you need any help with that

receiver={this.receiver}
value={this.state.email}
/>
{/* <button type="submit">Submit</button> */}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out code can be removed

@@ -0,0 +1,16 @@
<!DOCTYPE html>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend naming this file using lower case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants