diff --git a/IT_asset_management/app/templates/maintenance/index.html b/IT_asset_management/app/templates/maintenance/index.html index 0adf3e7..d673dcb 100644 --- a/IT_asset_management/app/templates/maintenance/index.html +++ b/IT_asset_management/app/templates/maintenance/index.html @@ -261,8 +261,9 @@ const form = document.getElementById('maintenanceForm'); const titleText = document.getElementById('modalTitleText'); const submitText = document.getElementById('submitBtnText'); -const createUrl = "{{ url_for('maintenance.create') }}"; -const updateUrl = (id) => `/maintenance/${id}/update`; +const createUrl = "{{ url_for('maintenance.create') }}"; +const _updateBase = "{{ url_for('maintenance.update', record_id=0) }}"; +const updateUrl = (id) => _updateBase.replace('/0/', `/${id}/`); // ── Open for EDIT when a table row is clicked ──────────────────────────────── document.querySelectorAll('tr[data-id]').forEach(row => {