chore: super deep cleaning of temp scripts and mock data

This commit is contained in:
Rafif-Riqullah-Siregar committed 2026-07-07 23:40:46 +07:00
1 parent 764c87c3c8
commit d559f00b8a
29 files changed
+6 -1224

No files matched your search

-24
View File
@@ -1,24 +0,0 @@
import { NextResponse } from 'next/server';
import mongoose from 'mongoose';
import { DeviceStat, Summary, AppStat, ProtocolStat, Flow, Threat } from '../../../../backend/models/Schemas';
export async function GET() {
try {
// Check if mongoose is connected
if (mongoose.connection.readyState !== 1) {
return NextResponse.json({ error: 'MongoDB not connected on frontend route' }, { status: 500 });
}
await DeviceStat.deleteMany({});
await Summary.deleteMany({});
await AppStat.deleteMany({});
await ProtocolStat.deleteMany({});
await Flow.deleteMany({});
await Threat.deleteMany({});
return NextResponse.json({ message: 'All dummy data wiped from in-memory database successfully!' });
} catch (err: any) {
console.error(err);
return NextResponse.json({ error: err.message }, { status: 500 });
}
}