Skip to content

recruitment-web — Pages & Endpoints Catalog

บทนี้ (branch: prod) ไล่ทุกหน้าใน mainRoutes.js และทุก HTTP call ที่พบใน src/ ผ่าน axiosRc — เพื่อให้ผู้อ่าน map UI → API ได้โดยตรงโดยไม่ต้องเดา


Page: Home (/ และ /:org)

ส่วนไฟล์บทบาท
Shellpages/home/index.jsครอบ Header/Footer + provider
Contextpages/home/context/homeContext.jsโหลด dropdown + รายการงาน
Scope1content/scope1/*banner, search form, carousel
Scope2–4`content/scope23
AIcontent/aiRecommend/*แนะนำงานจาก AI (ถ้า login)

HTTP

MethodPath (relative to recruitment-api base)CallerCitation
GET/jobList/get_default_datahomeContext.getDefaultDatahomeContext.js:82
GET/jobList/get_by_org_unit_id/?orgUnitId=...&searchKeyword=...homeContext.getDataByOrgUnitIdhomeContext.js:153-164
GET/jobList/get_job_recommend_ai/{userId}formSearch.jsformSearch.js:111

พฤติกรรมพิเศษ: ถ้าไม่มี :org ใน URL และมี search_history ใน storage จะ history(/{orgUnitName}) (homeContext.js:96-102) มิฉะนั้นใช้ cards[0]

Theme/logo จาก response ถูกเขียนลง Recoil + home-image / rc-theme storage (homeContext.js:167-176)


Page: JobDetail (/JobDetail/:org/:jobId)

ส่วนไฟล์
Shellpages/jobDetail/index.js
Contentcontent/index.js, content-left.js, content-right.js, content-title.js
Relatedcontent/carousel/*
Bannerbanner.js

HTTP

MethodPathCallerCitation
GET/jobList/get_job_detail_by_id/{jobId}jobDetail/index.jsindex.js:19
PUT/jobRequest/update_visit body { id: jobId }หลังโหลดสำเร็จindex.js:27-30
GETcandidate/check_duplicate_jobRequestNo?email=&jobReqDocumentNo=ก่อนสมัครcontent/index.js:58
POSTcandidate/createสมัครจากหน้ารายละเอียดcontent/index.js:330

content-right.js ใช้ urlAttachFileRc() สำหรับแสดงไฟล์จาก path ที่ server คืน (content-right.js:6-13)


Page: JobHistory / MyJob (/MyJob)

ส่วนไฟล์
Shellpages/jobHistory/index.js
TablemyJobTable.js
Banner/Contentbanner.js, content.js

ต้องผ่าน OTP gate ใน App.js (ดู 02-core-pipeline)

HTTP

MethodPathCallerCitation
GET/candidate/get_list_my_job/?email=&appProfileId=fetchDatamyJobTable.js:25-26
GETcandidate/exportpdf_candidate?id= (blob)พิมพ์ใบสมัครmyJobTable.js:64-66
PUT/candidate/cancel_apply body { id }ยกเลิกสมัครmyJobTable.js:88-91

email และ appProfileId มาจาก JSON.parse(user.data) ใน localStorage (myJobTable.js:22-25) — PII ที่ decrypt แล้วถูกใช้สร้าง query string อีกชั้น


Page: ApplicantProfile (/ApplicantProfile)

ส่วนไฟล์
Shellpages/applicantProfile/index.js + DropdownDataProvider
Orchestratorcontent.js (~1400 บรรทัด)
Steps UIsteps.js + constant.js progressSteps
Sectionspersonal/, contact/, edu/, exp/, capability/, reference/, attachment/, criminal/, information/, consent/
UploaduploadForm.js

HTTP

MethodPathCallerCitation
GET/appProfile/get_dropdown_datadropdown contextdropdownDataContext.js:47
POSTappProfile/check_emp_redcrossก่อน savecontent.js:889
POSTappProfile/create_app_profileสร้างใหม่content.js:407
PUTappProfile/update_app_profileอัปเดตcontent.js:418
GET/appProfile/get_by_email/{email}refresh หลัง savecontent.js:490
GETcandidate/check_duplicate_jobRequestNo?...ก่อน applycontent.js:1250
POSTcandidate/createapply หลัง savecontent.js:1022

Preview ไฟล์ที่มี filePath แล้ว: urlAttachFile + filePath (uploadForm.js:84)

Consent step ใช้ react-pdf ผ่าน consent/PDFViewer.js และข้อความใน consent/constant.js / consentDetail.js


Page: Login modal (ไม่ใช่ route แยก)

เปิดจาก components/header/index.js เป็น Modal — ไม่มี path ของตัวเอง

ComponentบทบาทCitation
pages/login/index.jsเลือกแสดง SignIn / OTP / SignOut
form-signIn.jsกรอกอีเมล
form-otp.jsOTP 6 ช่อง + validateform-otp.js:48-62
form-signOut.jsโปรไฟล์ย่อ + ลบบัญชีform-signOut.js:53-175
otp-remaining.jscooldown ส่งซ้ำ
otp-remaining-expire.jsนับถอยหลังหมดอายุ OTP

HTTP (login / account)

MethodPathCallerCitation
GET/jobList/sent_otp/{email}handleLoginheader/index.js:232
GET/jobList/validate_otp/?email=&otp=handleConfirmOtpform-otp.js:51-52
GET/appProfile/get_by_email/{email}onFinish หลัง OTPheader/index.js:74
PUT/jobList/logout?email=onOkLogOutheader/index.js:266
GETdropdown/get_dropdown_by_type?dropdownType=delAccReasonform-signOutform-signOut.js:54-55
POSTdeleteHistory/create_delete_historyขอลบบัญชีform-signOut.js:175
PUTdeleteHistory/check_update_del_accยกเลิกลบheader/index.js:182
POST{base}/auth/refresh_tokenaxios interceptoraxios-rc.js:34

Page: RefreshData (/RefreshData)

พฤติกรรมCitation
localStorage.clear() แล้ว history('/')pages/clear/index.js:6-8
แสดงข้อความ Loading . . . ชั่วคราวpages/clear/index.js:11

ไม่มี HTTP call — ใช้ล้าง session ฝั่ง browser แบบ hard reset


Page: NotFound (/NotFound)

pages/notFound/index.js — หน้า 404 ภายในแอป; route * redirect ไป / ไม่ได้ชี้มาที่นี่โดยอัตโนมัติ (mainRoutes.js:39-41) ดังนั้น /NotFound ต้องถูก navigate มาเองถ้ามีจุดเรียก (ค้นหา caller ตาม task — UNVERIFIED ว่ามีลิงก์ภายในชี้มาบ่อยแค่ไหน)


Shared components ที่ยิง API

ComponentMethod / PathCitation
components/sharedModal.jsPOST Share/share_linksharedModal.js:47
components/footer/index.jsGET jobList/export_other_docfooter/index.js:83

ตารางรวม HTTP ทั้งหมดที่พบใน src/ (axiosRc)

เรียงตาม domain:

jobList / jobRequest

MethodPath patternFiles
GET/jobList/get_default_datahomeContext.js:82
GET/jobList/get_by_org_unit_id/{query}homeContext.js:164
GET/jobList/get_job_detail_by_id/{jobId}jobDetail/index.js:19
GET/jobList/get_job_recommend_ai/{userId}formSearch.js:111
GET/jobList/sent_otp/{email}header/index.js:232
GET/jobList/validate_otp/?email=&otp=form-otp.js:52
PUT/jobList/logout?email=header/index.js:266
GETjobList/export_other_docfooter/index.js:83
PUT/jobRequest/update_visitjobDetail/index.js:30

appProfile

MethodPath patternFiles
GET/appProfile/get_dropdown_datadropdownDataContext.js:47
GET/appProfile/get_by_email/{email}header/index.js:74, content.js:490
POSTappProfile/create_app_profilecontent.js:407
PUTappProfile/update_app_profilecontent.js:418
POSTappProfile/check_emp_redcrosscontent.js:889

candidate

MethodPath patternFiles
GET/candidate/get_list_my_job/{query}myJobTable.js:26
GETcandidate/check_duplicate_jobRequestNo{query}jobDetail/content/index.js:58, content.js:1250
POSTcandidate/createjobDetail/content/index.js:330, content.js:1022
PUT/candidate/cancel_applymyJobTable.js:91
GETcandidate/exportpdf_candidate?id=myJobTable.js:65
MethodPath patternFiles
GETdropdown/get_dropdown_by_type?dropdownType=form-signOut.js:55
POSTdeleteHistory/create_delete_historyform-signOut.js:175
PUTdeleteHistory/check_update_del_accheader/index.js:182
POSTShare/share_linksharedModal.js:47
POST/auth/refresh_tokenaxios-rc.js:34

Dead API surface (ไม่ถูกเรียกจาก UI)

MethodPathFileNote
POSTloginapi/login.js:5dead
POSTlogin/checkapi/login.js:17dead
POSTlogin/forgotpasswordapi/login.js:28dead
POSTlogin/resetPasswordapi/login.js:39dead

UI composition ต่อหน้า (สรุป)

Container
├── HeaderHome          ← login modal, logout, nav
├── [page body]
│   ├── Home            ← HomeContextProvider + scopes
│   ├── JobDetail       ← Banner + Content + related carousel
│   ├── JobHistory      ← Banner + MyJobTable
│   └── ApplicantProfile← Steps sidebar + 10 section forms
└── FooterHome          ← export_other_doc, links

Theme สี: DefaultTheme (แดง) vs blueTheme ตาม org (App.js:39-45, assets/styles/theme/index.js)

Font หลักใน config: 'Kanit', sans-serif (config.js:8)


สิ่งที่เล่มนี้ไม่ยืนยัน (UNVERIFIED)

  • Response schema เต็มของแต่ละ endpoint ฝั่ง recruitment-api (ต้องอ่าน repo recruitment-api แยก)
  • ว่า server ตรวจไฟล์/MIME/ขนาดซ้ำหรือไม่
  • ว่า REACT_APP_COOKIES ถูกอ่านที่จุดใดในโค้ด (ชื่อมีใน .env* — ต้อง grep เพิ่มก่อนสรุปว่าใช้จริง)
  • Deploy host จริงของ frontend (jobs.redcross.or.th vs อื่น) นอกเหนือจากค่าใน Dockerfile stage-2 / .env ที่ bake