-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
User can like job by swiping card to the right
- Loading branch information
Showing
4 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export const FACEBOOK_LOGIN_SUCCESS = 'facebook_login_success'; | ||
export const FACEBOOK_LOGIN_FAIL = 'facebook_login_fail'; | ||
export const FETCH_JOBS = 'fetch_jobs'; | ||
export const LIKE_JOB = 'like_job'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import { combineReducers } from "redux"; | ||
import auth from "./auth_reducer"; | ||
import jobs from "./jobs_reducer"; | ||
import likedJobs from "./likes_reducer"; | ||
|
||
export default combineReducers({ | ||
auth, jobs | ||
auth, jobs, likedJobs | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import _ from 'lodash'; | ||
import { | ||
LIKE_JOB | ||
} from '../actions/types'; | ||
|
||
export default function(state = [], action) { | ||
switch (action.type) { | ||
case LIKE_JOB: | ||
// only return unique jobs | ||
return _.uniqBy([ | ||
action.payload, ...state | ||
], 'jobkey'); | ||
default: | ||
return state; | ||
} | ||
} |