TimAConner / Jot

A streamlined note taking app for the scatterbrained, frequent note taker.
0 stars 0 forks source link

Add get all notes route #20

Closed TimAConner closed 6 years ago

TimAConner commented 6 years ago

Issue

Completes issue #4 (Get all notes route).

Description

Returns all notes for a given user, with each note's keywords, and most recent edit date.

Testing

When you navigate to /notes/ when not logged in, it should re-route you to the login page. When you are logged in and go there, you should receive an array of note objects. Example below:

[
  {
    "id": 1,
    "text": "This is an example note.",
    "user_id": 1,
    "Keywords": [
      {
        "id": 1,
        "keyword": "example",
        "user_selected": true,
        "note_id": 1
      },
      {
        "id": 2,
        "keyword": "note",
        "user_selected": true,
        "note_id": 1
      }
    ],
    "Note_Dates": [
      {
        "id": 1,
        "edit_date": "2018-04-30T21:27:14.209Z",
        "note_id": 1
      }
    ]
  }
]