Skip to content

[Feature Request] Add folderId reference to Note model API response #7

@jpsoaresXy

Description

@jpsoaresXy

While working on issue #4 , I noticed that the notes endpoint doesn't provide information about which folder a note belongs to. Currently, we have to iterate through all folders on the front-end to find this relationship.

Proposed Change:
Add a folderId (or parentFolder) field to the Note object in the API response:

{
  "_id": "69b0254a6da54bc49641ae1f",
  "title": "My Note",
  "folderId": "69b01d086da54bc49641adde", // New field
  ...
}

Benefits:

  • Performance: Eliminates the need for complex searches on the client side.
  • Simpler Logic: Reduces hooks (like useEffect and Context cross-referencing) in front-end components.
  • Consistency: Makes the data model more intuitive for future features (like Display folder icon on notes that belong to a specific folder #5 or "move to folder" actions).

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