Generic Medicines
test
Health Articles & Blogs — Frontend Wiring Report Files changed Frontend — modified (6) File Change health-articles-blogs-list.dto.ts Added backend row type (HealthContentApiRow), list response type, type↔label maps (article↔"Health Article", blog↔"Blog"), and toHealthContent() mapper (date→label, is_active→status). useHealthContentList.ts Loads list from API on mount (was mock array); added isLoading/error/busyId/actionError, onToggleStatus (optimistic + rollback), onDelete (confirm → soft delete → reload). Type filter + table engine unchanged (still client-side). health-articles-blogs/page.tsx Wired Activate/Deactivate + Delete buttons (with window.confirm), Activate/Deactivate swap by status, per-row disable while busy, loading/error/action-error lines. Layout untouched. add-health-content.dto.ts Added buildHealthContentFormData(values, file?) — camelCase→snake_case mapper; excerpt made required to match backend contract. useAddHealthContent.ts Real onSubmit: builds FormData, reads file from fileInputRef, POSTs, redirects to list on success; isSubmitting/submitError/submitSuccess. ET /health-content crashed with TypeError: Cannot set property query of #<IncomingMessage> which has only a getter — Express 5 made req.query getter-only, and this is the first
testing ·
10 Sep 2026 ·
5 min read
Read more