Added 1B, 2 and added bootstrap again for site
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { CircuitDeviceRowRepository } from "../src/db/repositories/circuit-device-row.repository.js";
|
||||
|
||||
async function run() {
|
||||
const rowId = process.argv[2];
|
||||
if (!rowId) {
|
||||
console.error("Usage: npm run dev:delete-circuit-row -- <rowId>");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const rowRepository = new CircuitDeviceRowRepository();
|
||||
const row = await rowRepository.findById(rowId);
|
||||
if (!row) {
|
||||
console.error(`Row not found: ${rowId}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
await rowRepository.delete(rowId);
|
||||
console.log(`Deleted row id: ${rowId}`);
|
||||
}
|
||||
|
||||
run().catch((error) => {
|
||||
console.error("Failed to delete row:", error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user