+ public function changeSort(string $id, string $type, Request $request)
+ {
+ $validSortTypes = ['books', 'bookshelves'];
+ if (!in_array($type, $validSortTypes)) {
+ return redirect()->back(500);
+ }
+ return $this->changeListSort($id, $request, $type);
+ }
+
+ /**
+ * Update the stored section expansion preference for the given user.
+ * @param string $id
+ * @param string $key
+ * @param Request $request
+ * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response
+ */
+ public function updateExpansionPreference(string $id, string $key, Request $request)