rsnext/examples/blog-starter/lib
Oiva Eskola c78b249c66
Fix falsy values not being returned in post fields (#29011)
I imported a bunch of old markdown posts to the blog-starter example but some of the post metadata was not returned by the API in the example code.

For example, having `published: false` in post metadata was not returned in the item fields.

The problem was in check:
```
if (data[field]) {
  items[field] = data[field]
}
```
This rejects all falsy values in addition to fields that are not set. Checking only for `undefined` should fix this issue.

I didn't find existing integration tests for the blog example nor an issue describing this problem.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2021-09-11 14:24:24 +00:00
..
api.js Fix falsy values not being returned in post fields (#29011) 2021-09-11 14:24:24 +00:00
constants.js Update .now.sh to .vercel.app. (#22359) 2021-04-14 09:46:06 -05:00
markdownToHtml.js Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00