Skip to content

Get all lists by User ID

Priyadarshini Saha requested to merge 83-retrieving-lists-based-on-user into main

Description

  • Retrieve a collection of TodoLists by specifying the user id

Issue

Issue 83

Feature

  • Retrieve a collection of TodoLists by specifying the user id

Tophatting

Use Postman API

Expected current behavior

  1. Retrieve all the lists owned by a user
  • Endpoint: http://localhost:8000/todo-list/all-lists/{userid}
    • userid: User's ID
  • HTTP: GET Request
  • Response Body: Collection
[
    {
        "list_id": 1,
        "list_name": "List 2",
        "category": "Combined",
        "is_favourite": true,
        "todo_items": [
            {
                "item_id": 1,
                "item_title": "bruh",
                "item_description": "List List",
                "priority": "MEDIUM",
                "is_flagged": true,
                "start_date": "2022-11-26 05:00:00",
                "end_date": "2022-11-26 05:00:00",
                "tag": "Kitty",
                "is_complete": true
            },
            {
                "item_id": 2,
                "item_title": "bruh",
                "item_description": "List List",
                "priority": "MEDIUM",
                "is_flagged": true,
                "start_date": "2022-11-27 05:00:00",
                "end_date": "2022-11-27 05:00:00",
                "tag": "Kitty",
                "is_complete": true
            },
            {
                "item_id": 3,
                "item_title": "bdksjhfh",
                "item_description": "List List",
                "priority": "MEDIUM",
                "is_flagged": true,
                "start_date": "2022-11-27 05:00:00",
                "end_date": "2022-11-27 05:00:00",
                "tag": "Kitty",
                "is_complete": true
            },
            {
                "item_id": 4,
                "item_title": "bdksjhfh",
                "item_description": "List List",
                "priority": "MEDIUM",
                "is_flagged": true,
                "start_date": "2022-11-28 05:00:00",
                "end_date": "2022-11-28 05:00:00",
                "tag": "Kitty",
                "is_complete": true
            },
            {
                "item_id": 9,
                "item_title": "SCI 206",
                "item_description": "Science Project",
                "priority": "MEDIUM",
                "is_flagged": true,
                "start_date": "2022-09-24 05:00:00",
                "end_date": "2022-10-02 05:00:00",
                "tag": "Prifhsdjkf",
                "is_complete": false
            },
            {
                "item_id": 10,
                "item_title": "bdksjhfh",
                "item_description": "List List",
                "priority": "MEDIUM",
                "is_flagged": true,
                "start_date": "2022-11-29 05:00:00",
                "end_date": "2022-11-29 05:00:00",
                "tag": "Kitty",
                "is_complete": true
            }
        ]
    }
]

Changes

  • Now you can retrieve all the lists owned by a specific user

Screenshots

None.

Design Patterns

List any design patterns used to accomplish this task

  • None

Deviations

Were there any deviations from the original design or architecture plan. If yes, what were they ?

  • None

Additional

  • Unit test written
  • Meets requirements
  • Cross-browser tested
  • Added/updated documentation as needed
  • Camel case style used

Closes #83 (closed)

Merge request reports