Skip to content

Commit e39a2bc

Browse files
committed
add stub
1 parent 1ce181a commit e39a2bc

File tree

12 files changed

+81
-1210
lines changed

12 files changed

+81
-1210
lines changed

TransferHeroku.postman_collection.json

Lines changed: 0 additions & 195 deletions
This file was deleted.

src/actions/table.action.js

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,33 @@ import * as API from "../api/api";
22

33
export const GET_TABLE = "GET_TABLE"
44
export const SAVE_TABLE = "SAVE_TABLE"
5+
export const _SUCCESS = "_SUCCESS"
6+
export const _PENDING = "_PENDING"
7+
export const _REJECTED = "_REJECTED"
58

69
export const getTable = () => ({
710
type: GET_TABLE,
811
payload: API.get('/table')
912
})
1013

11-
export const saveTable = (data) => ({
12-
type: SAVE_TABLE,
13-
payload: API.post('/table', data)
14-
})
14+
export const saveTable = (data) => dispatch => {
15+
dispatch(({
16+
type: SAVE_TABLE + _PENDING,
17+
payload: []
18+
}))
19+
API.post('/table', data).then(response => {
20+
dispatch(({
21+
type: SAVE_TABLE + _SUCCESS,
22+
payload: response
23+
}))
24+
dispatch(getTable())
25+
}).catch(err => {
26+
27+
dispatch(({
28+
type: SAVE_TABLE + _REJECTED,
29+
payload: []
30+
}))
31+
32+
})
33+
34+
}

src/assets/flaticon/Flaticon.eot

-9.86 KB
Binary file not shown.

0 commit comments

Comments
 (0)