Skip to content

i have many problem with this. see README#4

Open
Ethanng329 wants to merge 36 commits into
constructorlabs:masterfrom
Ethanng329:master
Open

i have many problem with this. see README#4
Ethanng329 wants to merge 36 commits into
constructorlabs:masterfrom
Ethanng329:master

Conversation

@Ethanng329

Copy link
Copy Markdown

No description provided.

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

Copy link
Copy Markdown
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

Comment thread index.js
res.json(orders);
});

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

Copy link
Copy Markdown
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

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

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

Copy link
Copy Markdown
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

Comment thread src/components/App.js Outdated
completeOrder: complete
});

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

Copy link
Copy Markdown
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

Comment thread src/components/App.js
import Header from './Header';
import Menu from './Menu';
// import Basket from './Basket';
import { METHODS } from 'http';

Copy link
Copy Markdown
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?

Comment thread src/components/App.js Outdated
import React from 'react';
import Header from './Header';
import Menu from './Menu';
// import Basket from './Basket';

Copy link
Copy Markdown
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

Comment thread src/components/App.js
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice

Comment thread src/components/App.js Outdated
}

handleClick(event) {
// event.preventDefault()

Copy link
Copy Markdown
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

Comment thread src/components/Basket.js
@@ -0,0 +1,13 @@
import React from 'react';
import { INSPECT_MAX_BYTES } from 'buffer';

Copy link
Copy Markdown
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?

Comment thread src/components/Menu.js
@@ -0,0 +1,37 @@
import React from 'react';
import { ENGINE_METHOD_DIGESTS } from 'constants';

Copy link
Copy Markdown
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?


// dfads@asfdsd.com

const chunks = email.split('@');

Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread views/Successorder.hbs
@@ -0,0 +1,16 @@
<!DOCTYPE html>

Copy link
Copy Markdown
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