Merge branch 'dev' of github.com:JoaquinPar/2800-202510-BBY14 into dev

This commit is contained in:
SowinskiBraeden committed 2025-05-21 13:59:20 -07:00
commit da0bfea655
1 file changed
+4 -2
+4 -2
View File
@@ -49,8 +49,10 @@ document.addEventListener('DOMContentLoaded', () => {
const result = await response.json(); const result = await response.json();
if (response.ok && result.success) { if (response.ok && result.success) {
// alert('Plan updated successfully!'); // Optional: show an alert const actionUrl = form.action;
window.location.href = `/plans/<%= plan._id %>`; // Redirect to plan detail page const urlParts = actionUrl.split('/');
const planId = urlParts[urlParts.length - 2];
window.location.href = `/plans/${planId}`;
} else { } else {
errorMessagesDiv.textContent = result.message || 'An error occurred while updating the plan.'; errorMessagesDiv.textContent = result.message || 'An error occurred while updating the plan.';
errorMessagesDiv.style.display = 'block'; errorMessagesDiv.style.display = 'block';