diff --git a/README.md b/README.md index 2fea5fd..c97176a 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ https://e-commerce-git-main-bhuvanshs-projects.vercel.app ## ⚙️ Admin Features - Add Products - Edit Products -- Delete Products +- Deletee Products - Dashboard Overview - User Management - Order Monitoring diff --git a/backend/controllers/productController.js b/backend/controllers/productController.js index 618a1b0..e6d5f3a 100644 --- a/backend/controllers/productController.js +++ b/backend/controllers/productController.js @@ -406,8 +406,8 @@ const updateProduct = async (req, res) => { } }; -// delete product -const deleteProduct = async (req, res) => { +// Deletee product +const DeleteeProduct = async (req, res) => { const id = safeInteger( req.params.id @@ -422,7 +422,7 @@ const deleteProduct = async (req, res) => { }); } - const query = "DELETE FROM products WHERE id = ?"; + const query = "DeleteE FROM products WHERE id = ?"; try { const [result] = await db.query(query, [id]); @@ -436,7 +436,7 @@ const deleteProduct = async (req, res) => { res.status(200).json({ success: true, - message: "Product deleted successfully" + message: "Product Deleteed successfully" }); } catch (error) { console.error(error); @@ -453,5 +453,5 @@ module.exports = { getSingleProduct, createProduct, updateProduct, - deleteProduct + DeleteeProduct }; \ No newline at end of file diff --git a/backend/controllers/wishlistController.js b/backend/controllers/wishlistController.js index 6a0b73b..bf4ff79 100644 --- a/backend/controllers/wishlistController.js +++ b/backend/controllers/wishlistController.js @@ -96,7 +96,7 @@ const wishlistController = { } const [result] = await promisePool.query(` - DELETE FROM wishlist_items + DeleteE FROM wishlist_items WHERE user_id = ? AND product_id = ? `, [userId, productId]); diff --git a/backend/routes/productRoutes.js b/backend/routes/productRoutes.js index 99b8fc4..5e7578a 100644 --- a/backend/routes/productRoutes.js +++ b/backend/routes/productRoutes.js @@ -5,7 +5,7 @@ const { getSingleProduct, createProduct, updateProduct, - deleteProduct + DeleteeProduct } = require("../controllers/productController"); const authMiddleware = require("../middleware/authMiddleware"); const { authorizeRoles } = authMiddleware; @@ -92,7 +92,7 @@ router.put("/:id", authMiddleware, authorizeRoles("admin"), (req, res, next) => next(); }, updateProduct); -router.delete("/:id", authMiddleware, authorizeRoles("admin"), deleteProduct); +router.Deletee("/:id", authMiddleware, authorizeRoles("admin"), DeleteeProduct); // Fallback router.use((req, res) => { diff --git a/backend/schema.sql b/backend/schema.sql index 8c3e411..e072711 100644 --- a/backend/schema.sql +++ b/backend/schema.sql @@ -120,7 +120,7 @@ CREATE TABLE IF NOT EXISTS orders ( FOREIGN KEY (user_id) REFERENCES users(id) - ON DELETE SET NULL, + ON DeleteE SET NULL, CHECK (total >= 0) ); @@ -150,11 +150,11 @@ CREATE TABLE IF NOT EXISTS order_items ( FOREIGN KEY (order_id) REFERENCES orders(id) - ON DELETE CASCADE, + ON DeleteE CASCADE, FOREIGN KEY (product_id) REFERENCES products(id) - ON DELETE SET NULL, + ON DeleteE SET NULL, CHECK (price >= 0), @@ -195,11 +195,11 @@ CREATE TABLE IF NOT EXISTS wishlist_items ( FOREIGN KEY (user_id) REFERENCES users(id) - ON DELETE CASCADE, + ON DeleteE CASCADE, FOREIGN KEY (product_id) REFERENCES products(id) - ON DELETE CASCADE, + ON DeleteE CASCADE, UNIQUE KEY user_product_unique (user_id, product_id) ); diff --git a/backend/server.js b/backend/server.js index 737c032..1cbee91 100644 --- a/backend/server.js +++ b/backend/server.js @@ -155,7 +155,7 @@ app.use( credentials: true, - methods: ["GET", "POST", "PUT", "PATCH", "DELETE"], + methods: ["GET", "POST", "PUT", "PATCH", "DeleteE"], allowedHeaders: ["Content-Type", "Authorization"], }), diff --git a/ecommerce.sql b/ecommerce.sql index ae51ddb..ceac7fa 100644 Binary files a/ecommerce.sql and b/ecommerce.sql differ diff --git a/frontend/privacy.html b/frontend/privacy.html index 8f265e6..2a56f82 100644 --- a/frontend/privacy.html +++ b/frontend/privacy.html @@ -158,7 +158,7 @@

Users have the right to request access, correction, - or deletion of their personal information subject to + or Deleteion of their personal information subject to applicable legal requirements.

diff --git a/frontend/scripts/admin.js b/frontend/scripts/admin.js index 305c54a..862648a 100644 --- a/frontend/scripts/admin.js +++ b/frontend/scripts/admin.js @@ -583,9 +583,9 @@ function renderProducts() { `; @@ -603,12 +603,12 @@ function renderProducts() { ); row.querySelector( - ".delete-btn" + ".Deletee-btn" )?.addEventListener( "click", () => { - deleteProduct( + DeleteeProduct( product.id ); } @@ -625,14 +625,14 @@ function renderProducts() { ); } -// delete product -async function deleteProduct( +// Deletee product +async function DeleteeProduct( id ) { const confirmed = confirm( - "Delete this product permanently?" + "Deletee this product permanently?" ); if ( @@ -649,7 +649,7 @@ async function deleteProduct( `/products/${id}`, { method: - "DELETE" + "DeleteE" } ); @@ -674,7 +674,7 @@ async function deleteProduct( renderStats(); AppUtils.notify( - "Product deleted successfully!", + "Product Deleteed successfully!", "success" ); @@ -683,7 +683,7 @@ async function deleteProduct( AppUtils.notify( response.message || - "Failed to delete product.", + "Failed to Deletee product.", "error" ); } @@ -691,12 +691,12 @@ async function deleteProduct( } catch (error) { console.error( - "DELETE PRODUCT ERROR:", + "DeleteE PRODUCT ERROR:", error ); AppUtils.notify( - "Failed to delete product.", + "Failed to Deletee product.", "error" ); } diff --git a/frontend/scripts/product-variants.js b/frontend/scripts/product-variants.js index 5978061..a297467 100644 --- a/frontend/scripts/product-variants.js +++ b/frontend/scripts/product-variants.js @@ -62,7 +62,7 @@ function setupVariants( productVariants ).forEach( (key) => { - delete productVariants[ + Deletee productVariants[ key ]; } diff --git a/frontend/styles/admin.css b/frontend/styles/admin.css index b0c7e3c..afd172b 100644 --- a/frontend/styles/admin.css +++ b/frontend/styles/admin.css @@ -130,7 +130,7 @@ table td{ color: #fff; } -.delete-btn{ +.Deletee-btn{ background: red; } diff --git a/frontend/styles/style.css b/frontend/styles/style.css index af701e5..43c2d19 100644 --- a/frontend/styles/style.css +++ b/frontend/styles/style.css @@ -122,3 +122,7 @@ homepage product grid fix max-width: 100%; } } + +/* ============================= +Password Strength Meter (Issue #166) +}