Skip to content

Commit ef4d9bf

Browse files
committed
Fix README on gate
1 parent 4dce939 commit ef4d9bf

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

gate/README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Bouquet::Gate
22

3-
This project rocks and uses MIT-LICENSE.
4-
3+
## API
54

5+
### Purchase Order
66

77
```
88
POST api/purchase_orders
@@ -15,11 +15,13 @@ POST api/purchase_orders
1515
}
1616
```
1717

18+
### Sales Order
19+
1820
```
1921
POST api/sales_orders
2022
2123
{
22-
"quantity": 10,
24+
"quantity": 1,
2325
"shipment_date": "2014-03-21",
2426
"product_id": 1,
2527
"customer_id": 1

store/private/static/app/actions/MaterialActions.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import * as types from '../constants/ActionTypes'
22
import 'isomorphic-fetch'
33

4+
const endpoint = 'http://localhost:3000'
5+
46
export function receiveMaterials(materials) {
57
return {
68
type: types.MATERIAL_RECEIVE,
@@ -10,7 +12,7 @@ export function receiveMaterials(materials) {
1012

1113
export function searchMaterials() {
1214
return dispatch => {
13-
return fetch('/api/materials')
15+
return fetch(endpoint + '/api/materials')
1416
.then(response => response.json())
1517
.then(json => dispatch(receiveMaterials(json)))
1618
}
@@ -26,7 +28,7 @@ export function showOrder(order) {
2628

2729
export function purchaseOrder(material_id) {
2830
return dispatch => {
29-
return fetch('/api/purchase_orders', {
31+
return fetch(endpoint + '/api/purchase_orders', {
3032
method: 'post',
3133
headers: {
3234
'Accept': 'application/json',

store/private/static/app/actions/ProductActions.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import * as types from '../constants/ActionTypes'
22
import 'isomorphic-fetch'
33

4+
const endpoint = 'http://localhost:3000'
5+
46
export function receiveProducts(products) {
57
return {
68
type: types.PRODUCT_RECEIVE,
@@ -10,7 +12,7 @@ export function receiveProducts(products) {
1012

1113
export function searchProducts() {
1214
return dispatch => {
13-
return fetch('/api/products')
15+
return fetch(endpoint + '/api/products')
1416
.then(response => response.json())
1517
.then(json => dispatch(receiveProducts(json)))
1618
}
@@ -26,7 +28,7 @@ export function showOrder(order) {
2628

2729
export function salesOrder(product_id) {
2830
return dispatch => {
29-
return fetch('/api/sales_orders', {
31+
return fetch(endpoint + '/api/sales_orders', {
3032
method: 'post',
3133
headers: {
3234
'Accept': 'application/json',

store/private/static/app/components/layouts/contents/material/layout.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Layout extends Component {
2222
return (
2323
<Card key={index} className={style.material}>
2424
<CardTitle title={material.name} />
25-
<CardText>Sales</CardText>
25+
<CardText>Purchase</CardText>
2626
<CardActions>
2727
<Button label="Order"
2828
onClick={::this.handleOrderClick.bind(this, material.id)} />

0 commit comments

Comments
 (0)