purge papaparse

This commit is contained in:
Alex Holliday committed 2026-01-21 09:52:31 -08:00
1 parent 63b4779961
commit 3fa370765e
6 files changed
+48 -92

No files matched your search

@@ -73,6 +73,7 @@ class IncidentController {
resolveIncidentManually = async (req: Request, res: Response, next: NextFunction) => {
try {
console.log({ user: req.user });
const resolvedIncident = await this.incidentService.resolveIncident(
req?.params?.incidentId,
req?.user?.id,
+5 -17
View File
@@ -174,27 +174,15 @@ class MonitorController {
createBulkMonitors = async (req: Request, res: Response, next: NextFunction) => {
try {
if (!req.file) {
throw new AppError({ message: "No file uploaded", status: 400 });
const userId = req.user?.id;
if (!userId) {
throw new AppError({ message: "User ID is required", status: 400 });
}
if (!req.file.mimetype.includes("csv")) {
throw new AppError({ message: "File is not a CSV", status: 400 });
}
if (req.file.size === 0) {
throw new AppError({ message: "File is empty", status: 400 });
}
const userId = requireString(req?.user?.id, "User ID");
const teamId = requireTeamId(req?.user?.teamId);
const fileData = req?.file?.buffer?.toString("utf-8");
if (!fileData) {
throw new AppError({ message: "Cannot get file from buffer", status: 400 });
}
const monitors = await this.monitorService.createBulkMonitors(fileData, userId, teamId);
const data = req.body;
const monitors = await this.monitorService.createBulkMonitors(data, userId, teamId);
return res.status(200).json({
success: true,