encoredev / example-app-diary

This is a lightweight Go application that allows you to easily log and record a journal or diary.
2 stars 1 forks source link

docs: README Endpoints are inverted #2

Closed bogdaaamn closed 2 years ago

bogdaaamn commented 2 years ago

Currently the README reads

Endpoints

Create new diary entry:

curl -X GET "http://localhost:4000/logbook/entries/2022-09-08" | jq
{
  "Entries": [
    {
      "Id": 1,
      "Time": "2022-09-08T16:25:21.409544Z",
      "Text": "I cooked fried eggs this morning. I forgot how much I loved them!"
    }
  ]
}

Listing all my entries for a specific date:

curl -X POST --data '{"Text":"I cooked fried eggs this morning. I forgot how much I loved them!"}' "http://localhost:4000/logbook/entries"
{
  "Id": 6,
  "Time": "2022-09-08T16:25:21.409544Z",
  "Text": "I cooked fried eggs this morning. I forgot how much I loved them!"
}

Whilst I believe you meant the other way around

Endpoints

Listing all my entries for a specific date:

curl -X GET "http://localhost:4000/logbook/entries/2022-09-08" | jq
{
  "Entries": [
    {
      "Id": 1,
      "Time": "2022-09-08T16:25:21.409544Z",
      "Text": "I cooked fried eggs this morning. I forgot how much I loved them!"
    }
  ]
}

Create new diary entry:

curl -X POST --data '{"Text":"I cooked fried eggs this morning. I forgot how much I loved them!"}' "http://localhost:4000/logbook/entries"
{
  "Id": 6,
  "Time": "2022-09-08T16:25:21.409544Z",
  "Text": "I cooked fried eggs this morning. I forgot how much I loved them!"
}
bih commented 2 years ago

Ah, of course! Good catch. Want to pop this in a PR and I can merge it? :)

bogdaaamn commented 2 years ago

Here we go #3 🤘🏼