diff --git a/components/data/OnlineStatus.tsx b/components/data/OnlineStatus.tsx index 628dc8da..4204398a 100644 --- a/components/data/OnlineStatus.tsx +++ b/components/data/OnlineStatus.tsx @@ -47,7 +47,7 @@ const OnlineStatus: FC = ({ item }) => { } return ( -
+ <> setShow(true)} @@ -64,7 +64,7 @@ const OnlineStatus: FC = ({ item }) => { close={() => setShow(false)} /> )} -
+ ) } diff --git a/lib/db/views.ts b/lib/db/views.ts index 8ec28614..48dc658a 100644 --- a/lib/db/views.ts +++ b/lib/db/views.ts @@ -27,6 +27,7 @@ export async function getLastViews(type: Types, n: number) { .limit(n) .toArray() ) + console.log('Found', data.length, 'entries in views table for', type) // count what has been popular recently let accumulated = {} diff --git a/pages/item/[id].tsx b/pages/item/[id].tsx index c54dbd3f..04f8857b 100644 --- a/pages/item/[id].tsx +++ b/pages/item/[id].tsx @@ -27,6 +27,7 @@ import { Column } from '../../types/Column' import { Collection } from '../../types/Collection' import DeleteButton from '../../components/buttons/DeleteButton' import { faStar } from '@fortawesome/free-solid-svg-icons/faStar' +import { findOneTyped, getAllTyped } from '../../lib/db/dbTyped' type Props = { item: Item @@ -359,7 +360,7 @@ const Item: FC = ({ item, columns, collections }) => { export default Item export async function getStaticPaths() { - const items = await getItems() + const items = await getAllTyped(Types.item) const paths = items.map((i) => { return { params: { @@ -375,7 +376,7 @@ export async function getStaticPaths() { } export async function getStaticProps({ params }) { - const item = await getItem(params.id) + const item = await findOneTyped(Types.item, params.id) as Item if (!item) { return { notFound: true,