Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BatchCandidat #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion codeidaca_client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"react-dom": "^17.0.2",
"react-helmet": "^6.1.0",
"react-helmet-async": "^1.2.2",
"react-icons": "^4.4.0",
"react-redux": "^7.2.6",
"react-router-dom": "^6.2.1",
"react-scripts": "5.0.0",
Expand All @@ -40,7 +41,8 @@
"redux-saga": "^1.1.3",
"video-react": "^0.15.0",
"web-vitals": "^2.1.4",
"yup": "^0.32.11"
"yup": "^0.32.11",
"react-paginate": "^8.1.3"
},
"scripts": {
"start": "react-scripts start",
Expand Down
48 changes: 25 additions & 23 deletions codeidaca_client/src/Routes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Navigate, useRoutes,Outlet,useNavigate } from 'react-router-dom';
import { Navigate, useRoutes, Outlet, useNavigate } from 'react-router-dom';
import AppLayout from './component/layout/AppLayout';
import LandingPage from './component/layout/LandingPageTest';
import MainLayout from './component/layout/MainLayout';
Expand Down Expand Up @@ -29,41 +29,43 @@ export default function Routes(isLoggedIn) {
return useRoutes([
{
path: '/',
element: <LandingPage/>,
element: <LandingPage />,
children: [
{ path: 'signin', element: <Navigate to="/auth/signin" /> },
{ path: 'signup', element: <Navigate to="/auth/signup" /> },
{ path: 'bootcamp', element: <Bootcamp/> },
{ path: 'signin', element: <Navigate to="/auth/signin" /> },
{ path: 'signup', element: <Navigate to="/auth/signup" /> },
{ path: 'bootcamp', element: <Bootcamp /> },
{ path: '404', element: <Page404 /> },
{ path: 'Location', element: <Location /> },
{ path: 'Setting', element: <Setting />,children:[
{ path: 'Location', element: <Location /> },
{ path: 'Category', element: <Category /> },
{ path: 'Module', element: <Module /> },
{ path: 'Skill', element: <Skill /> },
] },
{
path: 'Setting', element: <Setting />, children: [
{ path: 'Location', element: <Location /> },
{ path: 'Category', element: <Category /> },
{ path: 'Module', element: <Module /> },
{ path: 'Skill', element: <Skill /> },
]
},
]
},
{
path: '/auth',
element: <BlankLayout/>,
element: <BlankLayout />,
children: [
{ path: 'signin', element: <Signin/> },
{ path: 'signup', element: <Signup/> },
{ path: 'signin', element: <Signin /> },
{ path: 'signup', element: <Signup /> },
]
},
{
path: '/app',
element: <AppLayout/>,
element: <AppLayout />,
children: [
{ path: 'dashboard', element: isLoggedIn ? <Dashboard/> : <Navigate to="/auth/signin"/>},
{ path: 'candidat', element: isLoggedIn ? <Candidat/>: <Navigate to="/auth/signin"/> },
{ path: 'batch', element: isLoggedIn ? <Batch /> : <Navigate to="/auth/signin"/>},
{ path: 'placement', element: isLoggedIn ? <Placement />: <Navigate to="/auth/signin"/> },
{ path: 'talent', element: isLoggedIn ? <Talent />: <Navigate to="/auth/signin"/> },
{ path: 'curriculum', element: isLoggedIn ? <Curriculum />: <Navigate to="/auth/signin"/> },
{ path: 'hiring', element: isLoggedIn ? <Hiring /> : <Navigate to="/auth/signin"/> },
{ path: 'setting', element: isLoggedIn ? <Setting /> : <Navigate to="/auth/signin"/> },
{ path: 'dashboard', element: isLoggedIn ? <Dashboard /> : <Navigate to="/auth/signin" /> },
{ path: 'candidat', element: isLoggedIn ? <Candidat /> : <Navigate to="/auth/signin" /> },
{ path: 'batch', element: isLoggedIn ? <Batch /> : <Navigate to="/auth/signin" /> },
{ path: 'placement', element: isLoggedIn ? <Placement /> : <Navigate to="/auth/signin" /> },
{ path: 'talent', element: isLoggedIn ? <Talent /> : <Navigate to="/auth/signin" /> },
{ path: 'curriculum', element: isLoggedIn ? <Curriculum /> : <Navigate to="/auth/signin" /> },
{ path: 'hiring', element: isLoggedIn ? <Hiring /> : <Navigate to="/auth/signin" /> },
{ path: 'setting', element: isLoggedIn ? <Setting /> : <Navigate to="/auth/signin" /> },
]
},
{
Expand Down
104 changes: 104 additions & 0 deletions codeidaca_client/src/api/candidate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import axios from 'axios'
import config from '../config/config'

const apply = async () => {
try {
const result = await axios.get(`${config.domain}/candidate/apply`)
return result.data
} catch (error) {
return await error.message
}
}

const filtering = async () => {
try {
const result = await axios.get(`${config.domain}/candidate/filtering`)
return result.data
} catch (error) {
return await error.message
}
}

const contracted = async () => {
try {
const result = await axios.get(`${config.domain}/candidate/contracted`)
return result.data
} catch (error) {
return await error.message
}
}

const disqualified = async () => {
try {
const result = await axios.get(`${config.domain}/candidate/disqualified`)
return result.data
} catch (error) {
return await error.message
}
}

const notResponding = async () => {
try {
const result = await axios.get(`${config.domain}/candidate/not-responding`)
return result.data
} catch (error) {
return await error.message
}
}

const findOne = async (id) => {
try {
const result = await axios.get(`${config.domain}/candidate/id/${id}`)
return result.data
} catch (error) {
return error
}
}

const findOneFiltering = async (id) => {
try {
const result = await axios.get(`${config.domain}/candidate/filtering/${id}`)
return result.data
} catch (error) {
return error
}
}

const findOneContract = async (id) => {
try {
const result = await axios.get(`${config.domain}/candidate/contracted/${id}`)
return result.data
} catch (error) {
return error
}
}

const findOneDisqualified = async (id) => {
try {
const result = await axios.get(`${config.domain}/candidate/disqualified/${id}`)
return result.data
} catch (error) {
return error
}
}

const findOneNotResponding = async (id) => {
try {
const result = await axios.get(`${config.domain}/candidate/not-responding/${id}`)
return result.data
} catch (error) {
return error
}
}

const update = async (data) => {
const boap_entity_id = data.boap_entity_id
try {
const result = await axios.put(`${config.domain}/candidate/update/id/${boap_entity_id}`, data)
return result
} catch (error) {
return error
}
}

export default { apply, filtering, contracted, disqualified, notResponding, update, findOne, findOneFiltering, findOneContract, findOneDisqualified, findOneNotResponding }
45 changes: 45 additions & 0 deletions codeidaca_client/src/redux-saga/actions/CandidateAction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import * as ActionType from '../constants/CandidateConstant'

export const GetCandidateRequest = () => ({
type: ActionType.GET_CANDIDATE_REQUEST
})

export const GetCandidateSuccess = (payload) => ({
type: ActionType.GET_CANDIDATE_SUCCESS,
payload
})

export const GetCandidateFailed = (payload) => ({
type: ActionType.GET_CANDIDATE_FAILED,
payload
})

export const GetOneCandidateRequest = (payload) => ({
type : ActionType.GETONE_CANDIDATE_REQUEST,
payload
})

export const GetOneCandidateSuccess = (payload) => ({
type : ActionType.GETONE_CANDIDATE_SUCCESS,
payload
})

export const GetOneCandidateFailed = (payload) => ({
type : ActionType.GETONE_CANDIDATE_FAILED,
payload
})

export const EditCandidateRequest = (payload) => ({
type: ActionType.EDIT_CANDIDATE_REQUEST,
payload
})

export const EditCandidateSuccess = (payload) => ({
type: ActionType.EDIT_CANDIDATE_SUCCESS,
payload
})

export const EditCandidateFailed = (payload) => ({
type: ActionType.EDIT_CANDIDATE_FAILED,
payload
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import * as ActionType from '../constants/CandidateContractedConstant'

export const GetCandidateRequestContracted = () => ({
type: ActionType.GET_CANDIDATECONTRACTED_REQUEST
})

export const GetCandidateSuccessContracted = (payload) => ({
type: ActionType.GET_CANDIDATECONTRACTED_SUCCESS,
payload
})

export const GetCandidateFailedContracted = (payload) => ({
type: ActionType.GET_CANDIDATECONTRACTED_FAILED,
payload
})

export const EditCandidateRequestContracted = (payload) => ({
type: ActionType.EDIT_CANDIDATECONTRACTED_REQUEST,
payload
})

export const EditCandidateSuccessContracted = (payload) => ({
type: ActionType.EDIT_CANDIDATECONTRACTED_SUCCESS,
payload
})

export const EditCandidateFailedContracted = (payload) => ({
type: ActionType.EDIT_CANDIDATECONTRACTED_FAILED,
payload
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as ActionType from '../constants/CandidateDisqualifiedConstant'

export const GetCandidateRequestDisqulified = () => ({
type: ActionType.GET_CANDIDATEDISQUALIFIED_REQUEST
})

export const GetCandidateSuccessDisqulified = (payload) => ({
type: ActionType.GET_CANDIDATEDISQUALIFIED_SUCCESS,
payload
})

export const GetCandidateFailedDisqulified = (payload) => ({
type: ActionType.GET_CANDIDATEDISQUALIFIED_FAILED,
payload
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as ActionType from '../constants/CandidateFilteringConstant'

export const GetCandidateRequestFiltering = () => ({
type: ActionType.GET_CANDIDATEFILTERING_REQUEST
})

export const GetCandidateSuccessFiltering = (payload) => ({
type: ActionType.GET_CANDIDATEFILTERING_SUCCESS,
payload
})

export const GetCandidateFailedFiltering = (payload) => ({
type: ActionType.GET_CANDIDATEFILTERING_FAILED,
payload
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as ActionType from '../constants/CandidateNotrespondingConstant'

export const GetCandidateRequestNotresponding = () => ({
type: ActionType.GET_CANDIDATENOTRESPONDING_REQUEST
})

export const GetCandidateSuccessNotresponding = (payload) => ({
type: ActionType.GET_CANDIDATENOTRESPONDING_SUCCESS,
payload
})

export const GetCandidateFailedNotresponding = (payload) => ({
type: ActionType.GET_CANDIDATENOTRESPONDING_FAILED,
payload
})
11 changes: 11 additions & 0 deletions codeidaca_client/src/redux-saga/constants/CandidateConstant.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export const GET_CANDIDATE_REQUEST = 'candidate/get/request'
export const GET_CANDIDATE_SUCCESS = 'candidate/get/success'
export const GET_CANDIDATE_FAILED = 'candidate/get/failed'

export const GETONE_CANDIDATE_REQUEST = 'candidate/getone/request'
export const GETONE_CANDIDATE_SUCCESS = 'candidate/getone/success'
export const GETONE_CANDIDATE_FAILED = 'candidate/getone/failed'

export const EDIT_CANDIDATE_REQUEST = 'candidate/edit/request'
export const EDIT_CANDIDATE_SUCCESS = 'candidate/edit/success'
export const EDIT_CANDIDATE_FAILED = 'candidate/edit/failed'
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const GET_CANDIDATECONTRACTED_REQUEST = 'candidate/get/requestcontracted'
export const GET_CANDIDATECONTRACTED_SUCCESS = 'candidate/get/successcontracted'
export const GET_CANDIDATECONTRACTED_FAILED = 'candidate/get/failedcontracted'

export const EDIT_CANDIDATECONTRACTED_REQUEST = 'candidate/edit/requestcontracted'
export const EDIT_CANDIDATECONTRACTED_SUCCESS = 'candidate/edit/successcontracted'
export const EDIT_CANDIDATECONTRACTED_FAILED = 'candidate/edit/failedcontracted'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const GET_CANDIDATEDISQUALIFIED_REQUEST = 'candidate/get/requestdisqulified'
export const GET_CANDIDATEDISQUALIFIED_SUCCESS = 'candidate/get/successdisqulified'
export const GET_CANDIDATEDISQUALIFIED_FAILED = 'candidate/get/faileddisqulified'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const GET_CANDIDATEFILTERING_REQUEST = 'candidate/get/requestfiltering'
export const GET_CANDIDATEFILTERING_SUCCESS = 'candidate/get/successfiltering'
export const GET_CANDIDATEFILTERING_FAILED = 'candidate/get/failedfiltering'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const GET_CANDIDATENOTRESPONDING_REQUEST = 'candidate/get/requestnotresponding'
export const GET_CANDIDATENOTRESPONDING_SUCCESS = 'candidate/get/successnotresponding'
export const GET_CANDIDATENOTRESPONDING_FAILED = 'candidate/get/failednotresponding'
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { call, put } from 'redux-saga/effects'
import apiCandidate from '../../api/candidate'
import { GetCandidateSuccessContracted, GetCandidateFailedContracted, EditCandidateSuccessContracted, EditCandidateFailedContracted } from '../actions/CandidateContractedAction'

function* handleGetCandidateContracted() {
try {
const result = yield call(apiCandidate.contracted)
yield put(GetCandidateSuccessContracted(result))
} catch (error) {
yield put(GetCandidateFailedContracted(error))
}
}

function* handleEditCandidateContracted(action) {
const { payload } = action
try {
const result = yield call(apiCandidate.update, payload)
yield put(EditCandidateSuccessContracted(result))
} catch (error) {
yield put(EditCandidateFailedContracted(error))
}
}

export {
handleGetCandidateContracted,
handleEditCandidateContracted
}
Loading