Skip to content

Label Feature API implementation #10

@kavyashri-as

Description

@kavyashri-as

Overview

Implement the Label feature API for the Task Manager App. This feature allows users to categorize their tasks using labels, making it easier to organize and filter tasks.

Features to Implement

  • Create LabelPOST /labels – Create a new label with a name and color
  • Get All LabelsGET /labels – Retrieve all available labels
  • Get Label by IDGET /labels/:id – Retrieve a specific label
  • Update LabelPUT /labels/:id – Update a label's name or color
  • Delete LabelDELETE /labels/:id – Delete a label
  • Assign Label to TaskPOST /tasks/:id/labels – Assign one or more labels to a task
  • Remove Label from TaskDELETE /tasks/:id/labels/:labelId – Remove a label from a task
  • Filter Tasks by LabelGET /tasks?label=:labelName – Filter tasks based on their assigned label

Acceptance Criteria

  • Labels can be created, read, updated, and deleted (CRUD)
  • Labels can be assigned to and removed from tasks
  • Tasks can be filtered by label
  • All endpoints return appropriate HTTP status codes and JSON responses
  • Input validation is in place for label creation/update
  • Unit/integration tests cover the new endpoints

Technical Notes

  • Add a labels table/collection in the database
  • Add a task_labels join table for the many-to-many relationship between tasks and labels
  • Update database.js with the new schema
  • Add label routes in index.js
  • Update frontend (public/script.js, views/index.ejs) to support label assignment and filtering

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions