openstax / os-webview

:books: Front-end web application for the OpenStax web site

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handle invalid book slug for Details page

RoyEJohnson opened this issue · comments

Description

Going to a non-existent book details page like /details/books/notabook causes the code to go into a tight loop, making the page unresponsive. The user has to kill off the tab.

Also added a bit of code so that /subjects/ap reroutes to /subjects/high-school (where most unknown subjects route to view-all).

Acceptance criteria

Invalid book slug yields a 404 page, but the website remains responsive to navigate away from it.
/subjects/ap routes to /subjects/high-school; other /subjects/notasubject route to view all.

Verified in Staging.

Verified in Production.