Skip to content

Fix tasks API crashes, CSV export, and foreign keys#966

Open
PrashantGuptacodecraft wants to merge 1 commit into
Charushi06:mainfrom
PrashantGuptacodecraft:fix-studyplan-bugs
Open

Fix tasks API crashes, CSV export, and foreign keys#966
PrashantGuptacodecraft wants to merge 1 commit into
Charushi06:mainfrom
PrashantGuptacodecraft:fix-studyplan-bugs

Conversation

@PrashantGuptacodecraft
Copy link
Copy Markdown

Related Issue

Closes #ISSUE_NUMBER

Summary

This PR fixes 3 backend bugs: server crashes when adding tasks, broken CSV exports, and missing database constraints.

Changes Made

  • Fixed /api/tasks so it no longer crashes the server when tasks have validation errors.
  • Added quotes around text fields in the CSV export so commas no longer break the columns.
  • Enabled SQLite foreign keys in database.js to protect database relationships.

Testing

  • Tested adding multiple invalid tasks; the server returns a 400 error safely instead of crashing.
  • Exported a CSV with commas in the text and verified the file opens correctly.
  • Verified foreign keys are enabled when the server starts.

Screenshots

N/A

Checklist

  • Code follows project style
  • Tested locally
  • No unrelated changes included
  • Documentation updated (if applicable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant