From 13ae041d64c4d6230f8d55110938da59ab6e1d99 Mon Sep 17 00:00:00 2001 From: Freek Bes Date: Mon, 18 Nov 2024 14:00:28 +0100 Subject: [PATCH] fix: one-line csv for assigning custom points not working --- src/routes/admin/points.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/admin/points.ts b/src/routes/admin/points.ts index 6c5463c..fd775fa 100644 --- a/src/routes/admin/points.ts +++ b/src/routes/admin/points.ts @@ -491,7 +491,7 @@ export const setupAdminPointsRoutes = function(app: Express, prisma: PrismaClien const login = parts[0].trim(); const points = parseInt(parts[1].trim()); const reason = parts[2].trim(); - if (lineNumber === 1 && lines[1].indexOf(",") > -1 && (!login || isNaN(points) || !reason)) { + if ((!login || isNaN(points) || !reason) && lines.length > 1 && lineNumber === 1 && lines[1].indexOf(",") > -1) { // Assume first line is a header, next line contains columns too continue; }