@@ -930,7 +783,7 @@ const ApplicantStages = (props: any) => {
-
+
>
);
};
diff --git a/src/redux/actions/applicationStage.ts b/src/redux/actions/applicationStage.ts
index 563200285..badaabe1b 100644
--- a/src/redux/actions/applicationStage.ts
+++ b/src/redux/actions/applicationStage.ts
@@ -4,8 +4,6 @@ import {
advanceToNextStage,
filterByStage,
getApplicantStage,
- sendInterviewInvitation,
- updateInterviewStatus,
sendInvitation,
} from "../actiontypes/applicationTypes";
import toast from "react-hot-toast";
@@ -171,42 +169,29 @@ export const filterStage = (stage: string) => async (dispatch: any) => {
try {
const response = await axios.post("/", {
query: `query GetApplicantsByStage($stage: String!) {
- getApplicantsByStage(stage: $stage) {
- applicant {
- _id
- applicationPhase
- email
- firstName
- lastName
- status
- }
- technicalInterviews {
- _id
- meetingLink
- meetingPlatform
- status
- scheduledDate
- createdAt
- updatedAt
- coordinatorId {
- firstname
- lastname
- }
- }
+ getApplicantsByStage(stage: $stage) {
+ applicant {
+ _id
+ applicationPhase
+ email
+ firstName
+ lastName
status
- comments
- score
- platform
- invitationLink
- updatedAt
- createdAt
- }
- }`,
+ }
+ status
+ comments
+ score
+ platform
+ invitationLink
+ updatedAt
+ createdAt
+ }
+}`,
variables: {
stage: stage,
},
});
- if (response.data?.data?.getApplicantsByStage) {
+ if (response.data.data !== undefined || response.data.data !== null) {
dispatch({
type: filterByStage.FILTER_STAGE_SUCCESS,
data: response.data.data.getApplicantsByStage,
@@ -222,12 +207,7 @@ export const filterStage = (stage: string) => async (dispatch: any) => {
};
export const sendInvitations =
- (
- applicantId: string,
- email: string,
- platform: string,
- invitationLink: string
- ) =>
+ (applicantId: string, email: string, platform:string, invitationLink: string) =>
async (dispatch: any) => {
dispatch({
type: sendInvitation.SEND_INVITATION_STAGE_LOADING,
@@ -242,17 +222,14 @@ export const sendInvitations =
success
}
}`,
- variables: {
+ variables:{
applicantId: applicantId,
email: email,
platform: platform,
invitationLink: invitationLink,
- },
+ }
});
-
- const invitationResponse = response.data?.data?.sendInvitation;
-
- if (invitationResponse) {
+ if (response.data.data !== undefined || response.data.data !== null) {
dispatch({
type: sendInvitation.SEND_INVITATION_STAGE_SUCCESS,
data: response.data.data.sendInvitation,
@@ -267,111 +244,3 @@ export const sendInvitations =
console.error(error);
}
};
-export const sendInterviewInvitations =
- (
- applicantId: string,
- coordinatorId: string,
- meetingLink: string,
- scheduledDate: string,
- meetingPlatform: string
- ) =>
- async (dispatch: any) => {
- dispatch({
- type: sendInterviewInvitation.SEND_INTERVIEW_INVITATION_STAGE_LOADING,
- message: "loading",
- });
-
- try {
- const response = await axios.post("/", {
- query: `mutation ScheduleTechnicalInterview($input: ScheduleInterviewInput!) {
- scheduleTechnicalInterview(input: $input) {
- success
- message
- }
-}`,
- variables: {
- input: {
- applicantId,
- coordinatorId,
- meetingLink,
- scheduledDate,
- meetingPlatform,
- },
- },
- });
-
- console.log("Full response:", response.data);
-
- if (response.data?.data?.scheduleTechnicalInterview) {
- dispatch({
- type: sendInterviewInvitation.SEND_INTERVIEW_INVITATION_STAGE_SUCCESS,
- data: response.data.data.scheduleTechnicalInterview,
- });
- toast.success(response.data.data.scheduleTechnicalInterview.message);
- } else if (response.data.errors) {
- const errorMessage = response.data.errors[0].message;
- dispatch({
- type: sendInterviewInvitation.SEND_INTERVIEW_INVITATION_STAGE_FAIL,
- error: errorMessage,
- });
- toast.error(errorMessage);
- } else {
- dispatch({
- type: sendInterviewInvitation.SEND_INTERVIEW_INVITATION_STAGE_FAIL,
- error: "No data returned from the server",
- });
- toast.error("Failed to schedule interview");
- }
- } catch (error) {
- dispatch({
- type: sendInterviewInvitation.SEND_INTERVIEW_INVITATION_STAGE_FAIL,
- error,
- });
- console.error(error);
- }
- };
-
-export const updateInterviewStatuses =
- (interviewId: string, status: string) => async (dispatch: any) => {
- dispatch({
- type: updateInterviewStatus.UPDATE_INTERVIEW_STATUS_LOADING,
- message: "loading",
- });
-
- try {
- const response = await axios.post("/", {
- query: `mutation UpdateInterviewStatus($interviewId: ID!, $status: String!) {
- updateInterviewStatus(interviewId: $interviewId, status: $status) {
- success
- message
- }
- }`,
- variables: {
- interviewId,
- status,
- },
- });
-
- if (response.data?.data?.updateInterviewStatus) {
- dispatch({
- type: updateInterviewStatus.UPDATE_INTERVIEW_STATUS_SUCCESS,
- data: response.data.data.updateInterviewStatus,
- });
- toast.success(response.data.data.updateInterviewStatus.message);
- } else if (response.data.errors) {
- const errorMessage = response.data.errors[0].message;
- dispatch({
- type: updateInterviewStatus.UPDATE_INTERVIEW_STATUS_FAIL,
- error: errorMessage,
- });
- toast.error(errorMessage);
- }
- } catch (error) {
- dispatch({
- type: updateInterviewStatus.UPDATE_INTERVIEW_STATUS_FAIL,
- error: "Failed to update interview status",
- });
- console.error(error);
- toast.error("Failed to update interview status");
- }
- };
diff --git a/src/redux/actions/deletetraine.ts b/src/redux/actions/deletetraine.ts
index 6fda2df20..d484c58ff 100644
--- a/src/redux/actions/deletetraine.ts
+++ b/src/redux/actions/deletetraine.ts
@@ -164,23 +164,6 @@ export const fetchtraine = ({ page, itemsPerPage, All }: any) => {
resumeUrl
cycle_id {
name
- startDate
- endDate
- }
- technicalInterviews {
- _id
- meetingLink
- meetingPlatform
- status
- scheduledDate
- createdAt
- updatedAt
- coordinatorId {
- _id
- firstname
- lastname
- email
- }
}
}
itemsPerPage
@@ -204,7 +187,7 @@ export const fetchtraine = ({ page, itemsPerPage, All }: any) => {
}
)
.then((res) => {
- console.log("All traineessss", res);
+ console.log("All traineessss", res)
if (res.data.data) {
dispatch({
type: fetchtrainesss.fetchtraines_success,
diff --git a/src/redux/actions/users.ts b/src/redux/actions/users.ts
index ff9668e73..ecad6adf9 100644
--- a/src/redux/actions/users.ts
+++ b/src/redux/actions/users.ts
@@ -9,10 +9,12 @@ import {
} from "..";
import creator from "./creator";
-export const getAllMembers = () => async (dispatch: any) => {
- try {
- const data = await axios.post("/", {
- query: `
+
+export const getAllMembers=() => async (dispatch: any) => {
+
+ try {
+ const data = await axios.post("/",
+ { query: `
query getMembers {
getUsers_Logged {
firstname
@@ -37,19 +39,22 @@ export const getAllMembers = () => async (dispatch: any) => {
telephone
}
}
- `,
- });
+ `
+ }
+ );
dispatch({
type: fetchUser.fetchMembers,
- data: data.data,
+ data: data.data
+ ,
});
-
+
return data.data;
- } catch (err) {
+} catch (err){
console.log(err);
return err;
- }
-};
+
+}
+}
export const getSingleUser = (userId: string) => async (dispatch: any) => {
try {
const { data } = await axios.post("/", {
@@ -142,10 +147,11 @@ export const update_User =
}
};
-export const assignMemberRoles = async (userId, roleId) => {
+export const assignMemberRoles= async (userId, roleId) => {
+
try {
- const data = await axios.post("/", {
- query: `
+ const data = await axios.post("/",
+ { query: `
mutation Mutation( $assignRoleToUserId2: ID!, $roleId: ID!) {
assignRoleToUser(ID: $assignRoleToUserId2, roleID: $roleId) {
role {
@@ -165,24 +171,30 @@ export const assignMemberRoles = async (userId, roleId) => {
}
}
- `,
- variables: {
- assignRoleToUserId2: userId,
- roleId,
- },
- });
-
- return data.data;
- } catch (err) {
- console.log(err);
- return err;
- }
-};
+ `
+ ,
+ variables: {
+ assignRoleToUserId2: userId,
+ roleId
+ }
+ }
+ );
+
+ return data.data;
+
+} catch (err){
+ console.log(err);
+ return err;
+
+}
+}
-export const getUserbyFilter = async (filter) => {
- try {
- const data = await axios.post("/", {
- query: `
+export const getUserbyFilter= async (filter) => {
+
+ try{
+ const data = await axios.post("/",
+ {
+ query: `
query GetByFilter($filter: UserFilterInput!) {
getByFilter(filter: $filter) {
id
@@ -201,18 +213,18 @@ export const getUserbyFilter = async (filter) => {
}
`,
- variables: {
- filter: {
- ...filter,
- },
- },
- });
- return data.data;
- } catch (err) {
- console.log(err);
- return err;
- }
-};
+ variables: {
+ filter: {
+ ...filter
+ }
+ }
+ });
+ return data.data;
+ } catch (err){
+ console.log(err);
+ return err;
+ }
+}
export const updateUserSelf = async (id: string, data: object) => {
const query = `
@@ -225,7 +237,7 @@ export const updateUserSelf = async (id: string, data: object) => {
id,
editUserInput: { ...data },
};
-
+
try {
const response = await axios.post("/", {
query,
@@ -243,7 +255,6 @@ export const getAllCoordinators = () => async (dispatch: any) => {
query: `
query getMembers {
getUsers_Logged {
- id
firstname
lastname
email
@@ -267,8 +278,8 @@ export const getAllCoordinators = () => async (dispatch: any) => {
data: coordinators,
});
- return coordinators;
+ return coordinators.length;
} catch (err) {
- return 0;
+ return 0;
}
};
diff --git a/src/redux/actiontypes/applicationTypes.ts b/src/redux/actiontypes/applicationTypes.ts
index b54b29f86..91e92e88e 100644
--- a/src/redux/actiontypes/applicationTypes.ts
+++ b/src/redux/actiontypes/applicationTypes.ts
@@ -1,41 +1,37 @@
export enum fetchMyApplications {
- FETCH_MYAPPLICATIONS_LOADING = "FETCH_MY_APPLICATIONS_LOADING",
- FETCH_MYAPPLICATIONS_SUCCESS = "FETCH_MY_APPLICATIONS_SUCCESS",
- FETCH_MYAPPLICATIONS_FAIL = "FETCH_MY_APPLICATIONS_FAIL",
- APPLICATION_DELETED_SUCCESS = "APPLICATION_DELETED_SUCCESS",
+ FETCH_MYAPPLICATIONS_LOADING = 'FETCH_MY_APPLICATIONS_LOADING',
+ FETCH_MYAPPLICATIONS_SUCCESS = 'FETCH_MY_APPLICATIONS_SUCCESS',
+ FETCH_MYAPPLICATIONS_FAIL = 'FETCH_MY_APPLICATIONS_FAIL',
+ APPLICATION_DELETED_SUCCESS = 'APPLICATION_DELETED_SUCCESS',
}
export enum deleteOwnApplication {
- DELETE_APPLICATION_LOADING = "DELETE_APPLICATION_LOADING",
- DELETE_APPLICATION_SUCCESS = "DELETE_APPLICATION_SUCCESS",
- DELETE_APPLICATION_FAIL = "DELETE_APPLICATION_FAIL",
+ DELETE_APPLICATION_LOADING = 'DELETE_APPLICATION_LOADING',
+ DELETE_APPLICATION_SUCCESS = 'DELETE_APPLICATION_SUCCESS',
+ DELETE_APPLICATION_FAIL = 'DELETE_APPLICATION_FAIL',
}
export enum fetchSingleOwnApplication {
- FETCH_SINGLE_APPLICATION_LOADING = "FETCH_SINGLE_APPLICATION_LOADING",
- FETCH_SINGLE_APPLICATION_SUCCESS = "FETCH_SINGLE_APPLICATION_SUCCESS",
- FETCH_SINGLE_APPLICATION_FAIL = "FETCH_SINGLE_APPLICATION_FAIL",
+ FETCH_SINGLE_APPLICATION_LOADING = 'FETCH_SINGLE_APPLICATION_LOADING',
+ FETCH_SINGLE_APPLICATION_SUCCESS = 'FETCH_SINGLE_APPLICATION_SUCCESS',
+ FETCH_SINGLE_APPLICATION_FAIL = 'FETCH_SINGLE_APPLICATION_FAIL',
}
export enum advanceToNextStage {
- ADVANCE_TO_NEXT_STAGE_LOADING = "ADVANCE_TO_NEXT_STAGE_LOADING",
- ADVANCE_TO_NEXT_STAGE_SUCCESS = "ADVANCE_TO_NEXT_STAGE_SUCCESS",
- ADVANCE_TO_NEXT_STAGE_FAIL = "ADVANCE_TO_NEXT_STAGE_FAIL",
-}
-export enum updateInterviewStatus {
- UPDATE_INTERVIEW_STATUS_LOADING = "UPDATE_INTERVIEW_STATUS_LOADING",
- UPDATE_INTERVIEW_STATUS_SUCCESS = "UPDATE_INTERVIEW_STATUS_SUCCESS",
- UPDATE_INTERVIEW_STATUS_FAIL = "UPDATE_INTERVIEW_STATUS_FAIL",
+ ADVANCE_TO_NEXT_STAGE_LOADING = 'ADVANCE_TO_NEXT_STAGE_LOADING',
+ ADVANCE_TO_NEXT_STAGE_SUCCESS = 'ADVANCE_TO_NEXT_STAGE_SUCCESS',
+ ADVANCE_TO_NEXT_STAGE_FAIL = 'ADVANCE_TO_NEXT_STAGE_FAIL',
}
export enum getApplicantStage {
- GET_APPLICANT_STAGE_LOADING = "GET_APPLICANT_STAGE_LOADING",
- GET_APPLICANT_STAGE_SUCCESS = "GET_APPLICANT_STAGE_SUCCESS",
- GET_APPLICANT_STAGE_FAIL = "GET_APPLICANT_STAGE_FAIL",
+ GET_APPLICANT_STAGE_LOADING = 'GET_APPLICANT_STAGE_LOADING',
+ GET_APPLICANT_STAGE_SUCCESS = 'GET_APPLICANT_STAGE_SUCCESS',
+ GET_APPLICANT_STAGE_FAIL = 'GET_APPLICANT_STAGE_FAIL',
}
export enum addStageMark {
ADD_STAGE_MARK_LOADING = "ADD_STAGE_MARK_LOADING",
ADD_STAGE_MARK_SUCCESS = "ADD_STAGE_MARK_SUCCESS",
ADD_STAGE_MARK_FAIL = "ADD_STAGE_MARK_FAIL",
+
}
export enum filterByStage {
@@ -49,11 +45,6 @@ export enum sendInvitation {
SEND_INVITATION_STAGE_SUCCESS = "SEND_INVITATION_STAGE_SUCCESS",
SEND_INVITATION_STAGE_FAIL = "SEND_INVITATION_STAGE_FAIL",
}
-export enum sendInterviewInvitation {
- SEND_INTERVIEW_INVITATION_STAGE_LOADING = "SEND_INTERVIEW_INVITATION_STAGE_LOADING",
- SEND_INTERVIEW_INVITATION_STAGE_SUCCESS = "SEND_INTERVIEW_INVITATION_STAGE_SUCCESS",
- SEND_INTERVIEW_INVITATION_STAGE_FAIL = "SEND_INTERVIEW_INVITATION_STAGE_FAIL",
-}
interface actionPending {
type: fetchMyApplications.FETCH_MYAPPLICATIONS_LOADING;
}
@@ -115,84 +106,57 @@ interface advanceToNextStageActionFail {
message: any;
}
-interface updateInterviewStatusActionPending {
- type: updateInterviewStatus.UPDATE_INTERVIEW_STATUS_LOADING;
-}
-interface updateInterviewStatusActionSuccess {
- type: updateInterviewStatus.UPDATE_INTERVIEW_STATUS_SUCCESS;
- message: string;
- data: any;
-}
-
-interface updateInterviewStatusActionFail {
- type: updateInterviewStatus.UPDATE_INTERVIEW_STATUS_FAIL;
- message: any;
-}
-
-interface getApplicantStageActionPending {
+interface getApplicantStageActionPending{
type: getApplicantStage.GET_APPLICANT_STAGE_LOADING;
}
-interface getApplicantStageActionSuccess {
+interface getApplicantStageActionSuccess{
type: getApplicantStage.GET_APPLICANT_STAGE_SUCCESS;
message: string;
data: any;
}
-interface getApplicantStageActionFail {
+interface getApplicantStageActionFail{
type: getApplicantStage.GET_APPLICANT_STAGE_FAIL;
error: any;
}
-interface addStageMarkActionPending {
+interface addStageMarkActionPending{
type: addStageMark.ADD_STAGE_MARK_LOADING;
}
-interface addStageMarkActionSuccess {
+interface addStageMarkActionSuccess{
type: addStageMark.ADD_STAGE_MARK_SUCCESS;
message: string;
data: any;
}
-interface filterByStageActionFail {
+interface filterByStageActionFail{
type: filterByStage.FILTER_STAGE_FAIL;
message: any;
}
-interface filterByStageActionPending {
+interface filterByStageActionPending{
type: filterByStage.FILTER_STAGE_LOADING;
}
-interface filterByStageActionSuccess {
+interface filterByStageActionSuccess{
type: filterByStage.FILTER_STAGE_SUCCESS;
message: string;
data: any;
}
-interface sendInvitationActionFail {
+interface sendInvitationActionFail{
type: sendInvitation.SEND_INVITATION_STAGE_FAIL;
message: any;
}
-interface sendInvitationActionPending {
+interface sendInvitationActionPending{
type: sendInvitation.SEND_INVITATION_STAGE_LOADING;
}
-interface sendInvitationActionSuccess {
+interface sendInvitationActionSuccess{
type: sendInvitation.SEND_INVITATION_STAGE_SUCCESS;
message: string;
data: any;
}
-interface sendInterviewInvitationActionFail {
- type: sendInterviewInvitation.SEND_INTERVIEW_INVITATION_STAGE_FAIL;
- message: any;
-}
-
-interface sendInterviewInvitationActionPending {
- type: sendInterviewInvitation.SEND_INTERVIEW_INVITATION_STAGE_LOADING;
-}
-interface sendInterviewInvitationActionSuccess {
- type: sendInterviewInvitation.SEND_INTERVIEW_INVITATION_STAGE_SUCCESS;
- message: string;
- data: any;
-}
-interface addStageMarkActionFail {
+interface addStageMarkActionFail{
type: addStageMark.ADD_STAGE_MARK_FAIL;
message: any;
}
@@ -210,9 +174,6 @@ export type Action =
| advanceToNextStageActionPending
| advanceToNextStageActionFail
| advanceToNextStageActionSuccess
- | updateInterviewStatusActionPending
- | updateInterviewStatusActionFail
- | updateInterviewStatusActionSuccess
| getApplicantStageActionPending
| getApplicantStageActionFail
| getApplicantStageActionSuccess
@@ -225,6 +186,3 @@ export type Action =
| sendInvitationActionPending
| sendInvitationActionFail
| sendInvitationActionSuccess
- | sendInterviewInvitationActionPending
- | sendInterviewInvitationActionFail
- | sendInterviewInvitationActionSuccess;
diff --git a/src/redux/index.ts b/src/redux/index.ts
index 9127c0ddf..ccbbcf383 100644
--- a/src/redux/index.ts
+++ b/src/redux/index.ts
@@ -1,69 +1,68 @@
-export const INCREMENT = "INCREMENT";
-export const DECREMENT = "DECREMENT";
-export const GET_ONE_TRAINEES_ALL_DETAILS = "GET_ONE_TRAINEES_ALL_DETAILS";
-export const GET_TRAINEE = "GET_TRAINEE";
-export const SET_TRAINEE = "SET_TRAINEE";
-export const CREATE_TRAINEES = "CREATE_TRAINEES";
-export const GET_CYCLES = "GET_CYCLES";
-export const CREATE_CYCLES = "CREATE_CYCLES";
-export const UPDATE_CYCLE = "UPDATE_CYCLE";
-export const DELETE_CYCLE = "DELETE_CYCLE";
-export const CREATE_CYCLE_ERROR = "CREATE_CYCLE_ERROR";
-export const UPDATE_CYCLE_ERROR = "UPDATE_CYCLE_ERROR";
-export const DELETE_CYCLE_ERROR = "DELETE_CYCLE_ERROR";
-export const GET_SOFT_DELETED_TRAINEES = "GET_SOFT_DELETED_TRAINEES";
-export const GET_SOFT_DELETED_TRAINEES_ERROR =
- "GET_SOFT_DELETED_TRAINEES_ERROR";
-export const GET_ALL_FILTERED_TRAINEES = "GET_ALL_FILTERED_TRAINEES";
-export const GET_ALL_FILTERED_PROGRAMS = "GET_ALL_FILTERED_PROGRAMS";
-export const GET_ALL_FILTERED_JOB_POST = "GET_ALL_FILTERED_JOB_POST";
-export const GET_ALL_FILTERED_ROLES_ACCESS = "GET_ALL_FILTERED_ROLES_ACCESS";
-export const LOAD_DATA_INTO_DB_REQUEST = "LOAD_DATA_INTO_DB_REQUEST";
-export const LOAD_DATA_INTO_DB_SUCCESS = "LOAD_DATA_INTO_DB_SUCCESS";
-export const LOAD_DATA_INTO_DB_FAIL = "LOAD_DATA_INTO_DB_FAIL";
-export const RESEND_MAPPED_DATA_INTO_DB = "RESEND_MAPPED_DATA_INTO_DB";
-export const GET_TRAINEE_TO_UPDATE = "GET_TRAINEE_TO_UPDATE";
-export const GET_TRAINEE_TO_UPDATE_FAIL = "GET_TRAINEE_TO_UPDATE_FAIL";
-export const UPDATE_TRAINEE = "UPDATE_TRAINEE";
-export const UPDATE_TRAINEE_FAIL = "UPDATE_TRAINEE_FAIL";
-export const UPDATE_TRAINEE_ATTRIBUTE = "UPDATE_TRAINEE_ATTRIBUTE";
-export const UPDATE_TRAINEE_ATTRIBUTE_FAIL = "UPDATE_TRAINEE_ATTRIBUTE_FAIL";
-export const EMPTYING_TRASH = "EMPTYING_TRASH";
-export const GET_ONE_TRAINEE_SCORE = "GET_ONE_TRAINEE_SCORE";
-export const UPDATE_TRAINEE_SCORE = "UPDATE_TRAINEE_SCORE";
-export const CREATE_TRAINEE_SCORE = "CREATE_TRAINEE_SCORE";
-export const GET_SCORE_TYPES = "GET_SCORE_TYPES";
-export const CREATE_SCORE_TYPE = "CREATE_SCORE_TYPE";
-export const CREATE_SCORE_ERROR = "CREATE_SCORE_ERROR";
-export const GET_ONE_SCORE_TYPE = "GET_ONE_SCORE_TYPE";
-export const GET_SCORE_VALUES = "GET_SCORE_VALUES";
-export const CREATE_SCORE_VALUES = "CREATE_SCORE_VALUES";
-export const CREATE_SCORE_VALUE_ERROR = "CREATE_SCORE_VALUE_ERROR";
-export const DELETE_SCORE_TYPE = "DELETE_SCORE_TYPE";
-export const DELETE_SCORE_ERROR = "DELETE_SCORE_ERROR";
-export const UPDATE_SCORE_TYPE = "UPDATE_SCORE_TYPE";
-export const UPDATE_SCORE_ERROR = "UPDATE_SCORE_ERROR";
-export const UPDATE_SCORE_VALUE = "UPDATE_SCORE_VALUE";
-export const UPDATE_SCORE_VALUE_ERROR = "UPDATE_SCORE_VALUE_ERROR";
-export const DELETE_SCORE_VALUE = "DELETE_SCORE_VALUE";
-export const DELETE_SCORE_VALUE_ERROR = "DELETE_SCORE_VALUE_ERROR";
-export const UPDATE_MANY_SCORE_VALUES = "UPDATE_MANY_SCORE_VALUES";
-export const UPDATE_TRAINEE_STATUS_FAIL = "UPDATE_TRAINEE_STATUS_FAIL";
-export const UPDATE_TRAINEE_STATUS = "UPDATE_TRAINEE_STATUS";
-export const LOGIN_USER = "LOGIN_USER";
-export const SEND_EMAIL = "SEND_EMAIL";
-export const SEND_EMAIL_ERROR = "SEND_EMAIL_ERROR";
-export const MY_APPLICATIONS = "MY_APPLICATIONS";
-export const GET_PROGRAMS = "GET_PROGRAMS";
-export const GET_Docs = "GET_Docs";
-export const GET_COHORTS = "GET_COHORTS";
-export const GET_TRAINEE_COHORT = "GET__TRAINEE_COHORT";
-export const CREATE_COHORT_SUCCESS = "CREATE_COHORT_SUCCESS";
-export const CREATE_COHORT_ERROR = "CREATE_COHORT_ERROR";
-export const GET_ONE_JOB_POST_ALL_DETAILS = "GET_ONE_JOB_POST_ALL_DETAILS";
-export const GET_TRAINEE_ATTENDANCE = "GET_TRAINEE_ATTENDANCE";
-export const GET_TRAINEE_PERFORMANCE = "GET_TRAINEE_PERFORMANCE";
-export const SINGLE_USER = "SINGLE_USER";
+export const INCREMENT = 'INCREMENT';
+export const DECREMENT = 'DECREMENT';
+export const GET_ONE_TRAINEES_ALL_DETAILS = 'GET_ONE_TRAINEES_ALL_DETAILS';
+export const GET_TRAINEE = 'GET_TRAINEE';
+export const SET_TRAINEE = 'SET_TRAINEE';
+export const CREATE_TRAINEES = 'CREATE_TRAINEES';
+export const GET_CYCLES = 'GET_CYCLES';
+export const CREATE_CYCLES = 'CREATE_CYCLES';
+export const UPDATE_CYCLE = 'UPDATE_CYCLE';
+export const DELETE_CYCLE = 'DELETE_CYCLE';
+export const CREATE_CYCLE_ERROR = 'CREATE_CYCLE_ERROR';
+export const UPDATE_CYCLE_ERROR = 'UPDATE_CYCLE_ERROR';
+export const DELETE_CYCLE_ERROR = 'DELETE_CYCLE_ERROR';
+export const GET_SOFT_DELETED_TRAINEES = 'GET_SOFT_DELETED_TRAINEES';
+export const GET_SOFT_DELETED_TRAINEES_ERROR ='GET_SOFT_DELETED_TRAINEES_ERROR';
+export const GET_ALL_FILTERED_TRAINEES = 'GET_ALL_FILTERED_TRAINEES';
+export const GET_ALL_FILTERED_PROGRAMS = 'GET_ALL_FILTERED_PROGRAMS';
+export const GET_ALL_FILTERED_JOB_POST = 'GET_ALL_FILTERED_JOB_POST';
+export const GET_ALL_FILTERED_ROLES_ACCESS = 'GET_ALL_FILTERED_ROLES_ACCESS';
+export const LOAD_DATA_INTO_DB_REQUEST = 'LOAD_DATA_INTO_DB_REQUEST';
+export const LOAD_DATA_INTO_DB_SUCCESS = 'LOAD_DATA_INTO_DB_SUCCESS';
+export const LOAD_DATA_INTO_DB_FAIL = 'LOAD_DATA_INTO_DB_FAIL';
+export const RESEND_MAPPED_DATA_INTO_DB = 'RESEND_MAPPED_DATA_INTO_DB';
+export const GET_TRAINEE_TO_UPDATE = 'GET_TRAINEE_TO_UPDATE';
+export const GET_TRAINEE_TO_UPDATE_FAIL = 'GET_TRAINEE_TO_UPDATE_FAIL';
+export const UPDATE_TRAINEE = 'UPDATE_TRAINEE';
+export const UPDATE_TRAINEE_FAIL = 'UPDATE_TRAINEE_FAIL';
+export const UPDATE_TRAINEE_ATTRIBUTE = 'UPDATE_TRAINEE_ATTRIBUTE';
+export const UPDATE_TRAINEE_ATTRIBUTE_FAIL = 'UPDATE_TRAINEE_ATTRIBUTE_FAIL';
+export const EMPTYING_TRASH = 'EMPTYING_TRASH';
+export const GET_ONE_TRAINEE_SCORE = 'GET_ONE_TRAINEE_SCORE';
+export const UPDATE_TRAINEE_SCORE = 'UPDATE_TRAINEE_SCORE';
+export const CREATE_TRAINEE_SCORE = 'CREATE_TRAINEE_SCORE';
+export const GET_SCORE_TYPES = 'GET_SCORE_TYPES';
+export const CREATE_SCORE_TYPE = 'CREATE_SCORE_TYPE';
+export const CREATE_SCORE_ERROR = 'CREATE_SCORE_ERROR';
+export const GET_ONE_SCORE_TYPE = 'GET_ONE_SCORE_TYPE';
+export const GET_SCORE_VALUES = 'GET_SCORE_VALUES';
+export const CREATE_SCORE_VALUES = 'CREATE_SCORE_VALUES';
+export const CREATE_SCORE_VALUE_ERROR = 'CREATE_SCORE_VALUE_ERROR';
+export const DELETE_SCORE_TYPE = 'DELETE_SCORE_TYPE';
+export const DELETE_SCORE_ERROR = 'DELETE_SCORE_ERROR';
+export const UPDATE_SCORE_TYPE = 'UPDATE_SCORE_TYPE';
+export const UPDATE_SCORE_ERROR = 'UPDATE_SCORE_ERROR';
+export const UPDATE_SCORE_VALUE = 'UPDATE_SCORE_VALUE';
+export const UPDATE_SCORE_VALUE_ERROR = 'UPDATE_SCORE_VALUE_ERROR';
+export const DELETE_SCORE_VALUE = 'DELETE_SCORE_VALUE';
+export const DELETE_SCORE_VALUE_ERROR = 'DELETE_SCORE_VALUE_ERROR';
+export const UPDATE_MANY_SCORE_VALUES = 'UPDATE_MANY_SCORE_VALUES';
+export const UPDATE_TRAINEE_STATUS_FAIL = 'UPDATE_TRAINEE_STATUS_FAIL';
+export const UPDATE_TRAINEE_STATUS = 'UPDATE_TRAINEE_STATUS';
+export const LOGIN_USER = 'LOGIN_USER';
+export const SEND_EMAIL = 'SEND_EMAIL';
+export const SEND_EMAIL_ERROR = 'SEND_EMAIL_ERROR';
+export const MY_APPLICATIONS = 'MY_APPLICATIONS';
+export const GET_PROGRAMS = 'GET_PROGRAMS';
+export const GET_Docs = 'GET_Docs';
+export const GET_COHORTS = 'GET_COHORTS';
+export const GET_TRAINEE_COHORT = 'GET__TRAINEE_COHORT';
+export const CREATE_COHORT_SUCCESS = 'CREATE_COHORT_SUCCESS';
+export const CREATE_COHORT_ERROR = 'CREATE_COHORT_ERROR';
+export const GET_ONE_JOB_POST_ALL_DETAILS = 'GET_ONE_JOB_POST_ALL_DETAILS';
+export const GET_TRAINEE_ATTENDANCE = 'GET_TRAINEE_ATTENDANCE';
+export const GET_TRAINEE_PERFORMANCE = 'GET_TRAINEE_PERFORMANCE';
+export const SINGLE_USER = 'SINGLE_USER';
export const SINGLE_USER_FAIL = "SINGLE_USER_FAIL";
export const USER_TO_UPDATE = "USER_TO_UPDATE";
export const USER_TO_UPDATE_FAIL = "USER_TO_UPDATE_FAIL";
@@ -109,16 +108,13 @@ export const FETCH_USER_BLOGS_FAIL = "FETCH_USER_BLOGS_FAIL";
export const FETCH_SINGLE_BLOG_LOADING = "FETCH_SINGLE_BLOG_LOADING";
export const FETCH_SINGLE_BLOG_SUCCESS = "FETCH_SINGLE_BLOG_SUCCESS";
export const FETCH_SINGLE_BLOG_FAIL = "FETCH_SINGLE_BLOG_FAIL";
-export const FETCH_BLOG_RELATED_ARTICLE_LOADING =
- "FETCH_BLOG_RELATED_ARTICLE_LOADING";
-export const FETCH_BLOG_RELATED_ARTICLE_SUCCESS =
- "FETCH_BLOG_RELATED_ARTICLE_SUCCESS";
-export const FETCH_BLOG_RELATED_ARTICLE_FAIL =
- "FETCH_BLOG_RELATED_ARTICLE_FAIL";
+export const FETCH_BLOG_RELATED_ARTICLE_LOADING = "FETCH_BLOG_RELATED_ARTICLE_LOADING";
+export const FETCH_BLOG_RELATED_ARTICLE_SUCCESS = "FETCH_BLOG_RELATED_ARTICLE_SUCCESS";
+export const FETCH_BLOG_RELATED_ARTICLE_FAIL = "FETCH_BLOG_RELATED_ARTICLE_FAIL";
export const HIDE_BLOG_LOADING = "HIDE_BLOG_LOADING";
export const HIDE_BLOG_SUCCESS = "HIDE_BLOG_SUCCESS";
-export const HIDE_BLOG_FAIL = "HIDE_BLOG_FAIL";
-export const GET_DOCS_BY_ROLE = "GET_DOCS_BY_ROLE";
+export const HIDE_BLOG_FAIL = "HIDE_BLOG_FAIL"
+export const GET_DOCS_BY_ROLE="GET_DOCS_BY_ROLE"
export const FETCH_COMMENTS_LOADING = "FETCH_COMMENTS_LOADING";
export const FETCH_COMMENTS_SUCCESS = "FETCH_COMMENTS_SUCCESS";
export const FETCH_COMMENTS_FAIL = "FETCH_COMMENTS_FAIL";
diff --git a/src/redux/reducers/applicationReducer.ts b/src/redux/reducers/applicationReducer.ts
index e606ff08b..daa4909e9 100644
--- a/src/redux/reducers/applicationReducer.ts
+++ b/src/redux/reducers/applicationReducer.ts
@@ -1,16 +1,15 @@
-import { toast } from "react-toastify";
+import { toast } from 'react-toastify';
import {
Action,
fetchMyApplications,
deleteOwnApplication,
fetchSingleOwnApplication,
advanceToNextStage,
- updateInterviewStatus,
getApplicantStage,
addStageMark,
filterByStage,
- sendInvitation,
-} from "../actiontypes/applicationTypes";
+ sendInvitation
+} from '../actiontypes/applicationTypes';
interface State {
success: boolean;
@@ -34,10 +33,10 @@ const initial = {
error: false,
message: null,
data: null,
-};
+}
export const applicationsReducer = (
state: State = initialState,
- action: Action
+ action: Action,
): State => {
switch (action.type) {
case fetchMyApplications.FETCH_MYAPPLICATIONS_LOADING:
@@ -67,7 +66,7 @@ export const applicationsReducer = (
case deleteOwnApplication.DELETE_APPLICATION_SUCCESS:
if (!action.data.id) {
- toast.error("Application has already been withdrawn");
+ toast.error('Application has already been withdrawn');
}
return {
// remove the application from the state
@@ -75,7 +74,7 @@ export const applicationsReducer = (
loading: false,
data: {
applications: state.data.applications.filter(
- (application: any) => application._id !== action.data.id
+ (application: any) => application._id !== action.data.id,
),
},
};
@@ -85,7 +84,7 @@ export const applicationsReducer = (
};
export const singleApplicationReducer = (
state: State = initialState,
- action: Action
+ action: Action,
): State => {
switch (action.type) {
case fetchSingleOwnApplication.FETCH_SINGLE_APPLICATION_LOADING:
@@ -117,10 +116,7 @@ export const singleApplicationReducer = (
}
};
-export const FetchApplicantStageReducer = (
- state: State = initial,
- action: Action
-) => {
+export const FetchApplicantStageReducer = (state:State = initial, action:Action) => {
switch (action.type) {
case getApplicantStage.GET_APPLICANT_STAGE_LOADING:
return {
@@ -147,12 +143,9 @@ export const FetchApplicantStageReducer = (
default:
return state;
}
-};
+}
-export const advanceToNextStageReducer = (
- state: State = initial,
- action: Action
-) => {
+export const advanceToNextStageReducer = (state:State = initial, action:Action) => {
switch (action.type) {
case advanceToNextStage.ADVANCE_TO_NEXT_STAGE_LOADING:
return {
@@ -174,7 +167,7 @@ export const advanceToNextStageReducer = (
return {
loading: false,
error: true,
- success: false,
+ success:false,
message: action.message,
data: null,
};
@@ -182,12 +175,9 @@ export const advanceToNextStageReducer = (
default:
return state;
}
-};
+}
-export const AddApplicantScoreReducer = (
- state: State = initial,
- action: Action
-) => {
+export const AddApplicantScoreReducer = (state:State = initial, action:Action) => {
switch (action.type) {
case addStageMark.ADD_STAGE_MARK_LOADING:
return {
@@ -214,12 +204,9 @@ export const AddApplicantScoreReducer = (
default:
return state;
}
-};
+}
-export const filterApplicantByStageReducer = (
- state: State = initial,
- action: Action
-) => {
+export const filterApplicantByStageReducer = (state:State = initial, action:Action) => {
switch (action.type) {
case filterByStage.FILTER_STAGE_LOADING:
return {
@@ -246,12 +233,9 @@ export const filterApplicantByStageReducer = (
default:
return state;
}
-};
+}
-export const sendInvitationReducer = (
- state: State = initial,
- action: Action
-) => {
+export const sendInvitationReducer = (state:State = initial, action:Action) => {
switch (action.type) {
case sendInvitation.SEND_INVITATION_STAGE_LOADING:
return {
@@ -278,36 +262,4 @@ export const sendInvitationReducer = (
default:
return state;
}
-};
-
-export const updateInterviewStatusReducer = (
- state: State = initial,
- action: Action
-) => {
- switch (action.type) {
- case updateInterviewStatus.UPDATE_INTERVIEW_STATUS_LOADING:
- return {
- loading: true,
- success: false,
- error: null,
- message: null,
- data: null,
- };
- case updateInterviewStatus.UPDATE_INTERVIEW_STATUS_SUCCESS:
- return {
- loading: false,
- success: true,
- message: action.message,
- data: action.data,
- };
- case updateInterviewStatus.UPDATE_INTERVIEW_STATUS_FAIL:
- return {
- loading: false,
- message: action.message,
- data: null,
- };
-
- default:
- return state;
- }
-};
+}
\ No newline at end of file
diff --git a/src/redux/reducers/index.ts b/src/redux/reducers/index.ts
index 2ef59088e..a670a9588 100644
--- a/src/redux/reducers/index.ts
+++ b/src/redux/reducers/index.ts
@@ -42,9 +42,8 @@ import {
FetchApplicantStageReducer,
AddApplicantScoreReducer,
advanceToNextStageReducer,
- updateInterviewStatusReducer,
filterApplicantByStageReducer,
- sendInvitationReducer,
+ sendInvitationReducer
} from "./applicationReducer";
import filterTicketReducer from "./filterTicketReducer";
@@ -126,7 +125,6 @@ const allReducers = combineReducers({
traineePerformance: performanceReducer,
loggedUser: getLoggedUserReducer,
nextStage: advanceToNextStageReducer,
- interviewStatus: updateInterviewStatusReducer,
fetchApplicantStage: FetchApplicantStageReducer,
AddedApplicantScore: AddApplicantScoreReducer,
filterApplicantByStage: filterApplicantByStageReducer,
diff --git a/src/redux/reducers/usersReducer.ts b/src/redux/reducers/usersReducer.ts
index 3a8aac82a..efc5611bb 100644
--- a/src/redux/reducers/usersReducer.ts
+++ b/src/redux/reducers/usersReducer.ts
@@ -1,44 +1,45 @@
import {
- Action,
- fetchtrainesss,
- fetchtrainapplicantscount,
- fetchtrainapplicantcount,
- fetchMembers,
- fetchUser,
-} from "../actiontypes/deleteactiontype";
+ Action,
+ fetchtrainesss,
+ fetchtrainapplicantscount,
+ fetchtrainapplicantcount,
+ fetchMembers,
+ fetchUser,
+ } from "../actiontypes/deleteactiontype";
-interface State {
- success: boolean;
- loading: boolean;
- error: any;
- message: any;
-}
-const initialState = {
- loading: false,
- success: false,
- error: null,
- message: null,
-};
+ interface State {
+ success: boolean;
+ loading: boolean;
+ error: any;
+ message: any;
+ }
-const traineState = {
- loading: false,
- success: false,
- error: null,
- message: null,
-};
+ const initialState = {
+ loading: false,
+ success: false,
+ error: null,
+ message: null,
+ };
-export const membersReducer = (
- state: any = traineState,
- action: fetchMembers
-): State => {
- switch (action.type) {
- case fetchUser.fetchMembers:
- return {
- ...state,
- message: action.data,
- };
- default:
- return state;
- }
-};
+ const traineState = {
+ loading: false,
+ success: false,
+ error: null,
+ message: null,
+ };
+
+ export const membersReducer = (
+ state: any = traineState,
+ action: fetchMembers
+ ): State => {
+ switch (action.type) {
+ case fetchUser.fetchMembers:
+ return {
+ ...state,
+ message: action.data.data,
+ };
+ default:
+ return state;
+ }
+ };
\ No newline at end of file
diff --git a/src/routes/routes.tsx b/src/routes/routes.tsx
index 84a3a3da1..a6d645baf 100644
--- a/src/routes/routes.tsx
+++ b/src/routes/routes.tsx
@@ -67,7 +67,7 @@ import SignupPage from "./../pages/SignupPage";
import ApplicantStages from "./../pages/TraineApplicant/ApplicantStages";
import AdminNotification from "../pages/AdminNotifications/AdminNotifications";
import { MyApplication } from "../pages/ApplicationCycle/myApplication";
-import ApplyJobPost from "../pages/ApplyJobPost";
+import ApplyJobPost from "../pages/ApplyJobPost"
import TraineeApply from "../pages/TraineeApply/TraineeApply";
import TraineeAttribute from "../pages/TraineeApply/TraineeAttribute";
@@ -81,9 +81,9 @@ import CohortPage from "../pages/Cohort/Cohort";
import CohortsDetailPage from "../pages/Cohort/CohortDetailPage";
import AllBlogs from "../pages/Blogs/allBlogs";
import SingleBlogView from "../pages/Blogs/singleBlog";
-import SingleBlogPage from "../pages/LandingPage/SingleBlogPage";
+import SingleBlogPage from "../pages/LandingPage/SingleBlogPage"
import LandingPage from "../pages/LandingPage/LandingPage";
-import Blogs from "../pages/Blogs/Blogs";
+import Blogs from "../pages/Blogs/Blogs"
import Documents from "../pages/documents/documents";
import UpdateDocumentation from "../pages/documents/updateDocumentation";
import SingleDocumentationDetails from "../pages/documents/singleDocumentation";
@@ -100,12 +100,12 @@ function Navigation() {
} />
} />
} />
- } />
+ }/>
} />
} />
} />
} />
- } />
+ }/>
- {/* Documentation routes */}
-
@@ -269,6 +270,9 @@ function Navigation() {
}
/>
+
+
+
+
-
+
}
/>
@@ -480,7 +485,7 @@ function Navigation() {
path="ticket/:id"
element={
-
+
}
/>
@@ -488,7 +493,7 @@ function Navigation() {
path="ticket/:id/resolve"
element={
-
+
}
/>
@@ -496,7 +501,7 @@ function Navigation() {
path="tickets"
element={
-
+
}
/>
@@ -504,7 +509,7 @@ function Navigation() {
path="ticket/:id"
element={
-
+
}
/>
@@ -512,7 +517,7 @@ function Navigation() {
path="ticket/:id/resolve"
element={
-
+
}
/>
@@ -525,6 +530,7 @@ function Navigation() {
}
/>
+
{/* Applicant Routes (Protected) */}
+
}
@@ -632,10 +638,11 @@ function Navigation() {
}
/>
-
+
}
@@ -643,12 +650,13 @@ function Navigation() {
+
}
/>
+
+
-
+
}
/>
@@ -787,7 +796,7 @@ function Navigation() {
path="ticket/:id"
element={
-
+
}
/>
@@ -795,7 +804,7 @@ function Navigation() {
path="ticket/:id/reply"
element={
-
+
}
/>
@@ -868,6 +877,7 @@ function Navigation() {
}
/>
+
{/* Catch-All Route */}
{
- const validData = interviewData
- .filter((item) => item)
- .map((item, index) => {
- const { email, firstName, lastName } = item.applicant || item;
-
- // Get interview status
- const interviewStatus =
- item.technicalInterviews && item.technicalInterviews[0]?.status
- ? item.technicalInterviews[0].status
- : item.status;
-
- const meetingPlatform =
- item.technicalInterviews &&
- item.technicalInterviews[0]?.meetingPlatform;
-
- return {
- Count: index + 1,
- EMAIL: email,
- "FIRST NAME": firstName,
- "LAST NAME": lastName,
- STATUS: interviewStatus || "N/A",
- "MEETING PLATFORM": meetingPlatform || "N/A",
- };
- })
- .filter(
- (row) => row.EMAIL && row["FIRST NAME"] && row["LAST NAME"] && row.STATUS
- );
-
- if (validData.length === 0) {
- console.warn("No valid data to export!");
- return;
- }
-
- const worksheet = XLSX.utils.json_to_sheet(validData);
-
- const headerRow = Object.keys(validData[0]);
-
- headerRow.forEach((header, index) => {
- const cellAddress = XLSX.utils.encode_cell({ r: 0, c: index });
- if (!worksheet[cellAddress]) return;
- worksheet[cellAddress].s = {
- fill: { fgColor: { rgb: "FFFF00" } },
- font: { bold: true, color: { rgb: "000000" } },
- alignment: { horizontal: "center", vertical: "center" },
- };
- });
-
- const workbook = XLSX.utils.book_new();
- XLSX.utils.book_append_sheet(workbook, worksheet, "Sheet1");
-
- const fileName = `${docName}.xlsx`;
- XLSX.writeFile(workbook, fileName);
-
- console.log(`Excel file created: ${fileName}`);
-};
|