Files
orangecat/scripts/test/create-product-api.js
Your Name 38cc4669d8 chore: comprehensive codebase cleanup and organization
- Move 100+ files from root to proper directories
  - Migration scripts → scripts/db/
  - SQL files → supabase/sql/archive/
  - Test/debug scripts → scripts/test/
  - Documentation → docs/archive/ (organized by category)
  - Shell scripts → scripts/ (organized by category)

- Fix test organization
  - Remove nested tests/unit/tests/unit/ structure
  - Consolidate test files to proper locations

- Update documentation references
  - Update migration script paths in workflow docs
  - Update scripts/README.md with moved file notes

- Delete placeholder files
  - Remove empty placeholder.ipynb

- Result: Root directory now contains only essential config files
- Result: Professional, organized codebase structure
- Result: All files in proper locations per project standards

See docs/CLEANUP_COMPLETE.md for full details.
2025-12-21 22:57:54 +01:00

42 lines
1.1 KiB
JavaScript

#!/usr/bin/env node
// Create Antique Menorah product via API
const productData = {
title: 'Antique Menorah',
description: 'Beautiful antique menorah from the 19th century, perfect for Hanukkah celebrations. Made of solid brass with intricate engravings.',
price_sats: 50000,
category: 'Antiques',
product_type: 'physical',
inventory_count: 1,
fulfillment_type: 'manual',
status: 'draft'
};
console.log('🎨 Creating Antique Menorah product via API...');
fetch('http://localhost:3005/api/products', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(productData)
})
.then(response => response.json())
.then(result => {
if (result.success) {
console.log('✅ Product created successfully!');
console.log('Product ID:', result.data.id);
console.log('Title:', result.data.title);
console.log('Price:', result.data.price_sats, 'sats');
console.log('Category:', result.data.category);
} else {
console.log('❌ Failed to create product:', result.error?.message || result.error);
}
})
.catch(error => {
console.error('Network error:', error.message);
});