Skip to content

Commit

Permalink
fix: one-line csv for assigning custom points not working
Browse files Browse the repository at this point in the history
  • Loading branch information
FreekBes committed Nov 18, 2024
1 parent 3a349a2 commit 13ae041
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/routes/admin/points.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 13ae041

Please sign in to comment.