reduxjs / redux

A JS library for predictable global state management

Home Page:https://redux.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Docs] Incorrect claim regarding /fakeApi/notifications response body

nanyaDev opened this issue · comments

commented

In Redux Essentials, Part 6: Performance and Normalizing Data it says:

Our fake API is already sending back the notification entries with isNew and read fields, so we can use those in our code.

The fake API doesn't doesn't actually send back notification entries with those fields. The response body for /fakeApi/notifications has the following shape (taken from my network tab):

[
    {
        "id": "dRlbcYxqEfaHY7--PSjDP",
        "date": "2023-08-23T16:20:17.229Z",
        "message": "is glad we're friends",
        "user": "KEsh5ntGEPkFQuJ2faaD5"
    },
    {
        "id": "V35OKeoD09Bgo3KCAWezR",
        "date": "2023-08-23T16:19:22.420Z",
        "message": "sent you a gift",
        "user": "KEsh5ntGEPkFQuJ2faaD5"
    },
    {
        "id": "uPCHUku1wC4ZtraWz4tgn",
        "date": "2023-08-23T16:23:40.075Z",
        "message": "poked you",
        "user": "KEsh5ntGEPkFQuJ2faaD5"
    }
]

I've checked the network request, the source code in server.js and even searched the entire repo and there is no mention of those fields.