Skip to content

Commit 093f531

Browse files
committed
Add infinite scroll pagination to likes and profile artwork, fix update/delete artwork
1 parent 5054831 commit 093f531

23 files changed

Lines changed: 246 additions & 163 deletions

cfg/defaults.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
const path = require('path');
1010
const srcPath = path.join(__dirname, '/../src');
11-
const npmPath = path.resolve(__dirname, '../node_modules');
1211
const dfltPort = 8000;
1312

1413
/**

cfg/dist.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,9 @@ config.module.loaders.push({
5454
)
5555
});
5656

57+
config.module.loaders.push({
58+
test: /\.(js|jsx)$/,
59+
loader: 'strip-loader?strip[]=console.log'
60+
});
61+
5762
module.exports = config;

dist/assets/app.js

Lines changed: 44 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assets/app.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assets/hub.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assets/hub.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"redux-logger": "^2.6.1",
6767
"rimraf": "^2.4.3",
6868
"sass-loader": "^3.1.2",
69+
"strip-loader": "^0.1.2",
6970
"style-loader": "^0.13.0",
7071
"url-loader": "^0.5.6",
7172
"webpack": "^1.12.0",

src/actions/artwork/createArtworkSuccess.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@ import { normalize } from 'normalizr';
22
import * as schema from '../schema';
33
import {CREATE_ARTWORK_SUCCESS} from './../const';
44

5+
6+
57
module.exports = function(response) {
6-
return {
7-
type: CREATE_ARTWORK_SUCCESS,
8-
response: normalize(response, schema.artwork)
8+
9+
return (dispatch, getState) => {
10+
const state = getState();
11+
dispatch({
12+
type: CREATE_ARTWORK_SUCCESS,
13+
response: normalize(response, schema.artwork),
14+
userId: state.user.current
15+
});
916
};
1017
};

src/actions/artwork/deleteArtworkRequest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import {DELETE_ARTWORK_REQUEST} from './../const';
22
import deleteArtworkSuccess from './deleteArtworkSuccess';
33
import deleteArtworkFailure from './deleteArtworkFailure';
4-
import { artwork } from '../../sources/api';
4+
import { users } from '../../sources/api';
55

66
module.exports = function(_artwork) {
77
return dispatch => {
88
dispatch({
99
type: DELETE_ARTWORK_REQUEST
1010
});
11-
return artwork.delete(_artwork.id).then(
11+
return users.deleteArtwork(_artwork.id).then(
1212
response => dispatch(deleteArtworkSuccess(_artwork)),
1313
error => dispatch(deleteArtworkFailure(error))
1414
);

src/actions/artwork/updateArtworkRequest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import {UPDATE_ARTWORK_REQUEST} from './../const';
22
import updateArtworkSuccess from './updateArtworkSuccess';
33
import updateArtworkFailure from './updateArtworkFailure';
4-
import {artwork} from '../../sources/api';
4+
import { users } from '../../sources/api';
55
module.exports = function(artworkId, data) {
66
return dispatch => {
77
dispatch({
88
type: UPDATE_ARTWORK_REQUEST
99
});
10-
return artwork.update(artworkId, data).then(
10+
return users.updateArtwork(artworkId, data).then(
1111
response => dispatch(updateArtworkSuccess(response)),
1212
error => {
1313
dispatch(updateArtworkFailure(error))

0 commit comments

Comments
 (0)