Skip to content

Task creation returns 422 and task retrieval returns 500 #15

Description

@Ripped-sys

Bug description

After running the project locally, user registration and sign-in work correctly, but task operations fail.

Creating a task returns:

POST /api/v1/tasks
422 Unprocessable Entity

Retrieving the current user's tasks returns:

GET /api/v1/tasks/user
500 Internal Server Error
Steps to reproduce
Start the Flask backend.
Start the React frontend.
Register and sign in.
Create a new task with a tag and due date.
Click Save.
Open or refresh the task list.
Expected behavior

The task should be created and displayed in the current user's task list.

Actual behavior
Task creation returns 422 Unprocessable Entity.
Task retrieval returns 500 Internal Server Error.
Root cause

The issues appear to be caused by frontend/backend type mismatches:

tagId is submitted as a string, while the backend expects an integer.
dueDate is submitted as YYYY-MM-DD, while the backend expects a full ISO datetime.
get_jwt_identity() returns a string, while the database user ID is an integer.
Proposed fix
Convert tagId to a number before submitting.
Convert dueDate to a full ISO datetime.
Convert the JWT identity to an integer before database comparisons.

A fix has been submitted in PR #14.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions