Skip to content

Fix the Create Project page #1

@shri30yans

Description

@shri30yans

Currently, the backend receives project update data through the API, but the sections array is not being stored in the database. We need to update the backend to store each section in the ProjectUpdatesTable with the ProjectID as a foreign key. Below is an example of the API data being received:

{
    "title": "Project Loop: New Feature Update",
    "description": "This update highlights the addition of the new recommendation algorithm.",
    "introduction": "We are excited to announce a significant update to Project Loop, focusing on improving user experience through personalized recommendations.",
    "sections": [
        {
            "update_number": 1,
            "title": "Initial Algorithm Development",
            "body": "The first version of the recommendation algorithm was developed using collaborative filtering techniques, aimed at improving user engagement."
        },
        {
            "update_number": 2,
            "title": "User Testing and Feedback",
            "body": "We conducted user testing sessions to gather feedback on the algorithm's performance and identify areas for improvement."
        },
        {
            "update_number": 3,
            "title": "Algorithm Optimization",
            "body": "Based on user feedback, we optimized the algorithm for faster response times and more accurate recommendations."
        }
    ],
    "tags": "feature-update, web-development, recommendations",
    "Title": "Major Update: Recommendation Algorithm"
}

The backend currently receives this payload but does not store the sections array. Each section must be stored in a new table called ProjectUpdatesTable, which should be linked to the relevant project via the ProjectID foreign key.

Requirements:

  1. Modify Database Functions: Update the database functions to store each section from the sections array in the ProjectUpdatesTable.
  2. SQL Queries: Write the necessary SQL queries to insert sections into the ProjectUpdatesTable. For example:
  3. API Router Function: Update the API router function to process the sections array and store each section.
  4. Ensure proper error handling for both project and section insertions.

Acceptance Criteria:

  1. Each section in the sections array is correctly stored in the ProjectUpdatesTable with the corresponding ProjectID.
  2. The ProjectUpdatesTable is properly linked to the project by the ProjectID foreign key.
  3. The API successfully stores project updates in the database and returns appropriate success/failure responses.
  4. The backend code is refactored to include all necessary SQL queries and database function updates.

Additional Notes:
Ensure that transactions are used to maintain data integrity when storing project updates.
Test for various edge cases, such as missing sections or empty arrays, and ensure appropriate responses are returned.
Coordinate with the frontend if any additional changes are required for the project update submission process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions