devsofttech_hms_ci4/app
DevSoftTech Server d025111bcc Fix: IPD discharge template delete not working
ISSUE: Delete button executed but did not actually delete templates
ROUTE: /setting/template/discharge_templates/delete/{id}

ROOT CAUSE:
The delete button's fetch() call was sending 'new FormData(form)' which:
1. Included entire edit form data (template_html, header_html, footer_html)
2. These are HUGE LONGTEXT fields that can cause request payload issues
3. CSRF token from form might be stale or missing if no template is being edited
4. Server received malformed request and silently failed

SOLUTION:
- Create fresh FormData with ONLY the CSRF token
- Delete request now lightweight and reliable
- Added success message display after successful delete
- Server-side delete logic already correct (line 2969-3028 in Template.php)

CHANGED:
- app/Views/Setting/Template/discharge_templates.php (line 618-653)
  - Replace: body: new FormData(form)
  - With: body: deleteFormData (contains only CSRF token)
  - Added: setNotice('success', ...) to show success message

TESTING:
1. Go to /setting/template/discharge_templates
2. Click Delete on any non-default template
3. Confirm deletion
4. Template should now be removed from list
5. Success message should display
2026-06-07 11:11:41 +05:30
..
Authentication/Authenticators Handle legacy null password hashes safely in session login 2026-03-05 14:08:30 +05:30
Commands Checkpoint: pathology panel modal workflow, gateway component search, and ABDM-style component/print editors 2026-05-30 06:32:30 +05:30
Config Add routes for debug endpoints - fix 404 errors 2026-06-07 07:48:43 +05:30
Controllers Fix: Prevent duplicate medicine saves on 'Save Discharge Advice' button 2026-06-07 09:03:12 +05:30
Database Add page settings and header footer support to discharge templates 2026-06-05 06:22:13 +05:30
Filters Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
Helpers Add OPD appointment time capture and storage with date+time display 2026-04-28 07:59:47 +05:30
Language Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
Libraries Add ABDM careContexts and OPD visit key 2026-06-01 13:54:56 +05:30
Models Simplify org-case queries to match CI3 pattern 2026-06-05 14:14:22 +05:30
ThirdParty Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
Validation Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
Views Fix: IPD discharge template delete not working 2026-06-07 11:11:41 +05:30
.htaccess Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
Common.php Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30
index.html Implement OPD template builder, doctor template selection, and OPD print integration fixes 2026-02-27 19:44:36 +05:30