From 67891c765533791a1a276e0669358b935ef9f697 Mon Sep 17 00:00:00 2001 From: zyachel Date: Sat, 24 Aug 2024 16:05:20 +0530 Subject: [PATCH] fix(list): remove list route as the upstream code has changed significantly, we'll need to rewrite it BREAKING CHANGE: will give 503 now --- src/pages/list/[listId]/index.tsx | 53 +++---------------------------- 1 file changed, 4 insertions(+), 49 deletions(-) diff --git a/src/pages/list/[listId]/index.tsx b/src/pages/list/[listId]/index.tsx index 8da548e..b5da846 100644 --- a/src/pages/list/[listId]/index.tsx +++ b/src/pages/list/[listId]/index.tsx @@ -1,54 +1,9 @@ -import { GetServerSideProps, InferGetServerSidePropsType } from 'next'; -import Meta from 'src/components/meta/Meta'; -import Layout from 'src/components/layout'; import ErrorInfo from 'src/components/error/ErrorInfo'; -import { Data, Meta as ListMeta, Pagination } from 'src/components/list'; -import { AppError } from 'src/interfaces/shared/error'; -import TList from 'src/interfaces/shared/list'; -import getOrSetApiCache from 'src/utils/getOrSetApiCache'; -import list from 'src/utils/fetchers/list'; -import { listKey } from 'src/utils/constants/keys'; -import styles from 'src/styles/modules/pages/list/list.module.scss'; +import { useRouter } from 'next/router'; -type Props = InferGetServerSidePropsType; - -const List = ({ data, error, originalPath }: Props) => { - if (error) return ; - - const description = data.description || `List created by ${data.meta.by.name} (${data.meta.num} ${data.meta.type}).` - - return ( - <> - - - - {/* @ts-expect-error don't have time to fix it. just a type fluff. */} - - - - - ); -}; - -type TData = ({ data: TList; error: null } | { error: AppError; data: null }) & { - originalPath: string; -}; -type Params = { listId: string }; - -export const getServerSideProps: GetServerSideProps = async ctx => { - const listId = ctx.params!.listId; - const pageNum = (ctx.query.page as string | undefined) ?? '1'; - const originalPath = ctx.resolvedUrl; - try { - const data = await getOrSetApiCache(listKey(listId, pageNum), list, listId, pageNum); - - return { props: { data, error: null, originalPath } }; - } catch (error: any) { - const { message = 'Internal server error', statusCode = 500 } = error; - ctx.res.statusCode = statusCode; - ctx.res.statusMessage = message; - return { props: { error: { message, statusCode }, data: null, originalPath } }; - } +const List = () => { + const router = useRouter(); + return ; }; export default List;