MerryFairyTalesAD440 / API

1 stars 2 forks source link

Books with no page object (not set to null) are causing 500 errors #109

Open mviencek opened 5 years ago

mviencek commented 5 years ago

Some books are not getting created correctly. There is no page object set to null. Like this one

{ "id": "f7603c88-278c-4211-bfc8-549644172954", "description": "This thought-provoking French children's book teaches lessons about life and human nature.", "author": " Antoine de Saint-Exupery", "cover_image": null, "title": "The Little Prince", "pages": null, "_rid": "QO9LAPsfmOM-AAAAAAAAAA==", "_self": "dbs/QO9LAA==/colls/QO9LAPsfmOM=/docs/QO9LAPsfmOM-AAAAAAAAAA==/", "_etag": "\"00004897-0000-0000-0000-5c8410c40000\"", "_attachments": "attachments/", "_ts": 1552158916 }

some are like this one

{ "id": "420797f2-7bd1-416d-9f18-e5680175a4bb", "description": "The second book in the series about the battle for Middle Earth.", "author": "JRR Tolkien", "title": "The Two Towers", "_rid": "QO9LAPsfmOMzAAAAAAAAAA==", "_self": "dbs/QO9LAA==/colls/QO9LAPsfmOM=/docs/QO9LAPsfmOMzAAAAAAAAAA==/", "_etag": "\"39003d8d-0000-0000-0000-5c7e02fe0000\"", "_attachments": "attachments/", "_ts": 1551762174 }

mviencek commented 5 years ago

Modify code to handle malformed book objects. Deployed to my one box and tested. Total time 2 hrs