diff --git a/callbacks/admin/addquestion.ts b/callbacks/admin/addquestion.ts index 9e1234f3..30cba859 100644 --- a/callbacks/admin/addquestion.ts +++ b/callbacks/admin/addquestion.ts @@ -13,6 +13,7 @@ export interface QuestionType { ID: number; CreatedAt: string; UpdatedAt: string; + event: string; type: string; question: string; recruitment_cycle_id: number; diff --git a/callbacks/admin/rc/proforma/question.ts b/callbacks/admin/rc/proforma/question.ts index cab68bc2..bf98e231 100644 --- a/callbacks/admin/rc/proforma/question.ts +++ b/callbacks/admin/rc/proforma/question.ts @@ -14,6 +14,7 @@ export interface QuestionProforma { qid: number; CreatedAt: string; UpdatedAt: string; + event: string; type: string; question: string; recruitment_cycle_id: number; diff --git a/callbacks/constants.ts b/callbacks/constants.ts index 1a2c611e..2e1a7a76 100644 --- a/callbacks/constants.ts +++ b/callbacks/constants.ts @@ -12,6 +12,7 @@ export const ADMIN_RC_URL = `${BASE_URL}/api/admin/rc`; export const ADMIN_STUDENT_URL = `${BASE_URL}/api/admin/student`; export const ADMIN_COMPANY_URL = `${BASE_URL}/api/admin/company`; export const ADMIN_APPLICATION_URL = `${BASE_URL}/api/admin/application`; +export const ADMIN_URL = `${BASE_URL}/api/admin`; export const CDN_URL = `${BASE_URL}/cdn`; diff --git a/callbacks/student/rc/applyQuestions.ts b/callbacks/student/rc/applyQuestions.ts index 2306fad5..c995fc91 100644 --- a/callbacks/student/rc/applyQuestions.ts +++ b/callbacks/student/rc/applyQuestions.ts @@ -11,6 +11,7 @@ import { errorNotification, successNotification } from "@callbacks/notifcation"; export interface studentApplicationQuestions { ID: number; proforma_id: number; + event: string; type: string; question: string; options: string; @@ -37,7 +38,10 @@ const responseBody = (response: AxiosResponse) => response.data; const applicationRequest = { getApplicationQuestion: (token: string, rcid: string, pid: string) => instance - .get(`/application/rc/${rcid}/opening/${pid}`, setConfig(token)) + .get( + `/application/rc/${rcid}/opening/${pid}`, + setConfig(token) + ) .then(responseBody) .catch((err: ErrorType) => { errorNotification("Error", err.response?.data?.error || err.message); diff --git a/components/Modals/AddApplyQuestion.tsx b/components/Modals/AddApplyQuestion.tsx index 88df55ac..83896fd2 100644 --- a/components/Modals/AddApplyQuestion.tsx +++ b/components/Modals/AddApplyQuestion.tsx @@ -64,6 +64,7 @@ function AddApplyQuestion({ ); if (response) { reset({ + event: "", question: "", mandatory: false, options: "", @@ -81,6 +82,18 @@ function AddApplyQuestion({

Additional Questions

+ + Application / Walk In Interview + + Type of Question { + let temp = [...selected]; + temp[params.row.ID] = e.target.value; + setSelected(temp); + }} + > + + None + + {resumes.map((resume) => { + if ( + resume.verified.Bool && + resume.verified.Valid && + resume.resume_type === "SINGLE" + ) { + return {resume.ID}; + } + return null; + })} + + + ), + }, + { + field: "action", + headerName: "Action", + width: 200, + sortable: false, + align: "center", + headerAlign: "center", + renderCell: (params) => ( + + + + ), + }, + ]; useEffect(() => { + const getEvents = async (res: ProformaParams[]) => { + let walkIns: (ProformaEvent & { company_name: string })[] = []; + await Promise.all( + res.map(async (proforma) => { + const ID = (proforma.ID || "").toString(); + const events = await sProformaRequest.getEvent(token, rid, ID); + events.forEach((event) => { + if (event.name === "Walk In") { + walkIns.push({ ...event, company_name: proforma.company_name }); + } + }); + }) + ); + setRow2(walkIns); + }; const getProforma = async () => { const res = await sProformaRequest.getAllOpenings(token, rid); setRows(res); setSelected(Array(res.length).fill("")); + getEvents(res); }; const getResume = async () => { const resume = await resumeRequest.get(token, rid); @@ -172,9 +306,21 @@ function Openings() { return (
- +

Job Openings

- row.ID} /> + row.ID} + /> +

Walk Ins

+ row.ID} + />
); diff --git a/pages/student/rc/[rcid]/opening/[openingid]/apply.tsx b/pages/student/rc/[rcid]/walkin/[walkinid]/apply.tsx similarity index 100% rename from pages/student/rc/[rcid]/opening/[openingid]/apply.tsx rename to pages/student/rc/[rcid]/walkin/[walkinid]/apply.tsx