Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit f4a6a81

Browse files
clean up code
1 parent cb61638 commit f4a6a81

File tree

3 files changed

+0
-99
lines changed

3 files changed

+0
-99
lines changed

src/actions/myGigs.js

-22
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@ import {
66
} from "../constants";
77
import service from "../services/myGigs";
88

9-
/**
10-
* Action to get my gigs.
11-
* @param {number} page page to fetch
12-
* @param {number} perPage items per page. by default is 10.
13-
* @returns
14-
*/
15-
// async function getMyGigs(status = "open_jobs", page = 1, perPage = PER_PAGE) {
16-
// return service.getMyGigs(status, page, perPage);
17-
// }
18-
199
async function getMyActiveGigs(
2010
status = "active_jobs",
2111
page = 1,
@@ -48,16 +38,6 @@ async function getMyArchivedGigsDone(
4838
return service.getMyGigs(status, page, perPage);
4939
}
5040

51-
/**
52-
* Action to load more pages of my gigs
53-
* @param {number} nextPage page to fetch
54-
* @param {*} perPage items per page. by default is 10
55-
* @returns
56-
*/
57-
// async function loadMoreMyGigs(status, nextPage, perPage = PER_PAGE) {
58-
// return service.getMyGigs(status, nextPage, perPage);
59-
// }
60-
6141
async function getProfile() {
6242
return service.getProfile();
6343
}
@@ -90,8 +70,6 @@ export default createActions({
9070
GET_MY_OPEN_GIGS: getMyOpenGigs,
9171
GET_MY_COMPLETED_GIGS: getMyCompletedGigs,
9272
GET_MY_ARCHIVED_GIGS: getMyArchivedGigsDone,
93-
// GET_MY_GIGS: getMyGigs,
94-
// LOAD_MORE_MY_GIGS: loadMoreMyGigs,
9573
GET_PROFILE: getProfile,
9674
UPDATE_PROFILE: updateProfile,
9775
START_CHECKING_GIGS: startCheckingGigs,

src/containers/MyGigs/index.jsx

-21
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,13 @@ import Empty from "../../components/Empty";
99
import JobListing from "./JobListing";
1010
import actions from "../../actions";
1111
import * as constants from "../../constants";
12-
// import * as utils from "../../utils";
1312

1413
import UpdateGigProfile from "./modals/UpdateGigProfile";
1514
import UpdateSuccess from "./modals/UpdateSuccess";
1615

1716
import "./styles.scss";
1817

1918
const MyGigs = ({
20-
// myGigs,
21-
// getMyGigs,
22-
// loadMore,
23-
// total,
24-
// numLoaded,
2519
myActiveGigs,
2620
myOpenGigs,
2721
myCompletedGigs,
@@ -40,16 +34,12 @@ const MyGigs = ({
4034
getMyCompletedGigs,
4135
getMyArchivedGigs,
4236
}) => {
43-
// const location = useLocation();
44-
// const params = utils.url.parseUrlQuery(location.search);
4537
const propsRef = useRef();
4638
propsRef.current = {
47-
// getMyGigs,
4839
getMyOpenGigs,
4940
getProfile,
5041
getAllCountries,
5142
startCheckingGigs,
52-
// params,
5343
};
5444

5545
useEffect(() => {
@@ -64,7 +54,6 @@ const MyGigs = ({
6454
return;
6555
}
6656
if (!checkingGigs) {
67-
// propsRef.current.getMyGigs();
6857
propsRef.current.getMyOpenGigs();
6958
}
7059
}, [checkingGigs]);
@@ -191,11 +180,6 @@ const MyGigs = ({
191180

192181
MyGigs.propTypes = {
193182
gigStatus: PT.string,
194-
// myGigs: PT.arrayOf(PT.shape()),
195-
// getMyGigs: PT.func,
196-
// loadMore: PT.func,
197-
// total: PT.number,
198-
// numLoaded: PT.number,
199183
profile: PT.shape(),
200184
getProfile: PT.func,
201185
updateProfile: PT.func,
@@ -217,9 +201,6 @@ MyGigs.propTypes = {
217201
const mapStateToProps = (state) => ({
218202
gigStatus: state.filter.gig.status,
219203
checkingGigs: state.myGigs.checkingGigs,
220-
// myGigs: state.myGigs.myGigs,
221-
// total: state.myGigs.total,
222-
// numLoaded: state.myGigs.numLoaded,
223204
loadingMyGigs: state.myGigs.loadingMyGigs,
224205
myActiveGigs: state.myGigs[constants.GIGS_FILTER_STATUSES.ACTIVE_JOBS],
225206
myOpenGigs: state.myGigs[constants.GIGS_FILTER_STATUSES.OPEN_JOBS],
@@ -230,8 +211,6 @@ const mapStateToProps = (state) => ({
230211
});
231212

232213
const mapDispatchToProps = {
233-
// getMyGigs: actions.myGigs.getMyGigs,
234-
// loadMore: actions.myGigs.loadMoreMyGigs,
235214
getMyActiveGigs: actions.myGigs.getMyActiveGigs,
236215
getMyOpenGigs: actions.myGigs.getMyOpenGigs,
237216
getMyCompletedGigs: actions.myGigs.getMyCompletedGigs,

src/reducers/myGigs.js

-56
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ import * as constants from "../constants";
55
const defaultState = {
66
loadingMyGigs: false,
77
loadingMyGigsError: null,
8-
// myGigs: null,
9-
// total: 0,
10-
// numLoaded: 0,
118
[constants.GIGS_FILTER_STATUSES.ACTIVE_JOBS]: {
129
myGigs: null,
1310
page: 1,
@@ -32,8 +29,6 @@ const defaultState = {
3229
numLoaded: 0,
3330
total: 0,
3431
},
35-
// loadingMore: false,
36-
// loadingMoreError: null,
3732
profile: {},
3833
loadingProfile: false,
3934
loadingProfileError: null,
@@ -43,21 +38,6 @@ const defaultState = {
4338
checkingGigs: false,
4439
};
4540

46-
// function onGetMyGigsInit(state) {
47-
// return { ...state, loadingMyGigs: true, loadingMyGigsError: null };
48-
// }
49-
50-
// function onGetMyGigsDone(state, { payload }) {
51-
// return {
52-
// ...state,
53-
// myGigs: sortBy(payload.myGigs, ["sortPrio"]),
54-
// total: payload.total,
55-
// numLoaded: payload.myGigs.length,
56-
// loadingMyGigs: false,
57-
// loadingMyGigsError: null,
58-
// };
59-
// }
60-
6141
function onGetMyActiveGigsInit(state) {
6242
return { ...state, loadingMyGigs: true, loadingMyGigsError: null };
6343
}
@@ -138,35 +118,6 @@ function onGetMyArchivedGigsDone(state, { payload }) {
138118
};
139119
}
140120

141-
// function onGetMyGigsFailure(state, { payload }) {
142-
// return {
143-
// ...state,
144-
// loadingMyGigs: false,
145-
// loadingMyGigsError: payload,
146-
// myGigs: null,
147-
// total: 0,
148-
// numLoaded: 0,
149-
// };
150-
// }
151-
152-
// function onLoadMoreMyGigsInit(state) {
153-
// return { ...state, loadingMore: true, loadingMoreError: null };
154-
// }
155-
156-
// function onLoadMoreMyGigsDone(state, { payload: { myGigs } }) {
157-
// return {
158-
// ...state,
159-
// myGigs: sortBy(state.myGigs.concat(myGigs), ["sortPrio"]),
160-
// numLoaded: state.numLoaded + size(myGigs),
161-
// loadingMore: false,
162-
// loadingMoreError: null,
163-
// };
164-
// }
165-
166-
// function onLoadMoreMyGigsFailure(state, { payload }) {
167-
// return { ...state, loadingMore: false, loadingMoreError: payload };
168-
// }
169-
170121
function onGetProfileInit(state) {
171122
return { ...state, loadingProfile: true, loadingProfileError: null };
172123
}
@@ -233,13 +184,6 @@ function onCheckingGigsDone(state) {
233184

234185
export default handleActions(
235186
{
236-
// GET_MY_GIGS_INIT: onGetMyGigsInit,
237-
// GET_MY_GIGS_DONE: onGetMyGigsDone,
238-
// GET_MY_GIGS_FAILURE: onGetMyGigsFailure,
239-
// LOAD_MORE_MY_GIGS_INIT: onLoadMoreMyGigsInit,
240-
// LOAD_MORE_MY_GIGS_DONE: onLoadMoreMyGigsDone,
241-
// LOAD_MORE_MY_GIGS_FAILURE: onLoadMoreMyGigsFailure,
242-
243187
GET_MY_ACTIVE_GIGS_INIT: onGetMyActiveGigsInit,
244188
GET_MY_ACTIVE_GIGS_DONE: onGetMyActiveGigsDone,
245189
GET_MY_OPEN_GIGS_INIT: onGetMyOpenGigsInit,

0 commit comments

Comments
 (0)