diff --git a/app.js b/app.js
index eab7165748b52e657aafc0508a7611b859cff030..6197b117bfcc917bc4f112574bf582af3ac98624 100644
--- a/app.js
+++ b/app.js
@@ -53,6 +53,10 @@ pool.getConnection()
 // Static file serving
 app.use(express.static(path.join(__dirname, 'public')));
 
+app.get('/edit-order', (req, res) => {
+    res.sendFile(path.join(__dirname, 'public', 'edit-order.html'));
+});
+
 // Session และ routes
 app.get('/', (req, res) => {
     if (req.session.user) {
diff --git a/public/edit.html b/public/edit-order.html
similarity index 82%
rename from public/edit.html
rename to public/edit-order.html
index 6c6d7233c2d8eaec87f700c8c7321a7bb8033170..f4ed37fe2b211f635e121cd092e4c51cfd62cd34 100644
--- a/public/edit.html
+++ b/public/edit-order.html
@@ -26,7 +26,15 @@
         // Load order details from the API
         async function loadOrderDetails() {
             try {
-                const orderId = 1; // Replace with dynamic order ID
+                // Get orderId from the URL query string
+                const urlParams = new URLSearchParams(window.location.search);
+                const orderId = urlParams.get('orderId'); // Get orderId from URL parameter
+
+                if (!orderId) {
+                    alert('Order ID is missing in the URL');
+                    return;
+                }
+
                 const response = await fetch(`/api/orders/${orderId}`);
                 const order = await response.json();
 
@@ -61,7 +69,15 @@
 
         // Update order details
         async function updateOrder() {
-            const orderId = 1; // Replace with dynamic order ID
+            // Get orderId from the URL query string
+            const urlParams = new URLSearchParams(window.location.search);
+            const orderId = urlParams.get('orderId');
+
+            if (!orderId) {
+                alert('Order ID is missing in the URL');
+                return;
+            }
+
             const status = document.getElementById('order-status').value;
             const shippingAddress = document.getElementById('order-shipping-address').value;
 
@@ -79,7 +95,7 @@
 
                 if (response.ok) {
                     alert('Order updated successfully!');
-                    window.location.href = '/'; // Redirect to home page or orders page
+                    window.location.href = '/orders'; // Redirect to orders page or home page
                 } else {
                     const errorMessage = await response.text();
                     alert('Error updating order: ' + errorMessage);