feat(reviews): add reviews route

allows seeing all reviews with optional filters.
works sans JS as well

closes https://github.com/zyachel/libremdb/issues/25
closes https://codeberg.org/zyachel/libremdb/issues/19
This commit is contained in:
zyachel
2024-03-31 15:37:44 +05:30
parent cf71cd39e1
commit dc42b3204c
29 changed files with 1053 additions and 31 deletions

View File

@ -11,6 +11,7 @@ import getOrSetApiCache from 'src/utils/getOrSetApiCache';
import { cleanQueryStr } from 'src/utils/helpers';
import { findKey } from 'src/utils/constants/keys';
import styles from 'src/styles/modules/pages/find/find.module.scss';
import { findFilterable } from 'src/utils/constants/find';
type Props = InferGetServerSidePropsType<typeof getServerSideProps>;
@ -58,8 +59,7 @@ export const getServerSideProps: GetServerSideProps<Data, FindQueryParams> = asy
if (!query) return { props: { data: { title: null, results: null }, error: null, originalPath } };
try {
const entries = Object.entries(queryObj);
const queryStr = cleanQueryStr(entries);
const queryStr = cleanQueryStr(queryObj, findFilterable);
const res = await getOrSetApiCache(findKey(queryStr), basicSearch, queryStr);