โ
Fix 1: Update Backend Schema (CRITICAL)
In your server.js, find the productSchema and change this:
// FIND THIS in your server.js (around line 280-290):
const productSchema = new mongoose.Schema({
// ... other fields ...
category: {
type: String,
required: true,
lowercase: true,
enum: ['clothing', 'accessories', 'equipment', 'merchandise', 'other'] // โ CHANGE THIS
},
// ... other fields ...
});
// CHANGE TO:
category: {
type: String,
required: true,
lowercase: true,
enum: ['apparel', 'accessories', 'equipment', 'collectibles', 'other'] // โ NEW VALUES
},
๐ก Alternative: Update Frontend Instead
Or change your admin panel dropdown to match backend:
// In your admin panel HTML, change:
<option value="apparel">Apparel</option>
<option value="collectibles">Collectibles</option>
// To:
<option value="clothing">Clothing</option>
<option value="merchandise">Merchandise</option>