30 lines
922 B
JavaScript
30 lines
922 B
JavaScript
#!/usr/bin/env node
|
|
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
console.log('🔄 Restoring real APIs...');
|
|
|
|
// Remove mock APIs
|
|
if (fs.existsSync('src/lib/api')) {
|
|
fs.rmSync('src/lib/api', { recursive: true });
|
|
}
|
|
if (fs.existsSync('src/lib/db')) {
|
|
fs.rmSync('src/lib/db', { recursive: true });
|
|
}
|
|
|
|
// Restore real APIs from backup
|
|
if (fs.existsSync('temp_api_backup')) {
|
|
if (fs.existsSync('temp_api_backup/api')) {
|
|
fs.cpSync('temp_api_backup/api', 'src/lib/api', { recursive: true });
|
|
}
|
|
if (fs.existsSync('temp_api_backup/db')) {
|
|
fs.cpSync('temp_api_backup/db', 'src/lib/db', { recursive: true });
|
|
}
|
|
|
|
console.log('✅ Restored real APIs! You can now use the full database functionality');
|
|
console.log('📝 To switch back to mocks for building, run: node switch-to-mocks.cjs');
|
|
} else {
|
|
console.log('❌ No backup found! Cannot restore real APIs');
|
|
}
|