Repository: isucon/isucon11-qualify (language: go)

Issue:
[frontend]Catalogの削除



Discussion / hints:

Fix patch:
diff --git a/webapp/frontend/src/components/IsuDetail/Catalog.tsx b/webapp/frontend/src/components/IsuDetail/Catalog.tsx
deleted file mode 100644
index bcbdf7229..000000000
--- a/webapp/frontend/src/components/IsuDetail/Catalog.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import { useEffect } from 'react'
-import { useState } from 'react'
-import apis, { Catalog, Isu } from '../../lib/apis'
-import NowLoading from '../UI/NowLoading'
-
-interface Props {
-  isu: Isu
-}
-
-const CatalogInfo = ({ isu }: Props) => {
-  const [catalog, setCatalog] = useState<Catalog | null>(null)
-
-  useEffect(() => {
-    const fetchCatalog = async () => {
-      setCatalog(await apis.getCatalog(isu.jia_catalog_id))
-    }
-    fetchCatalog()
-  }, [isu])
-
-  if (!catalog) {
-    return <NowLoading />
-  }
-  return (
-    <div>
-      <div className="mb-3 text-xl font-bold">Catalog</div>
-      <div className="flex flex-col gap-2 pl-2">
-        <CatalogRow property="name" value={catalog.name} />
-        <CatalogRow property="size" value={catalog.size} />
-        <CatalogRow property="weight" value={`${catalog.weight}`} />
-        <CatalogRow property="limit weight" value={`${catalog.limit_weight}`} />
-        <CatalogRow property="maker" value={catalog.maker} />
-        <CatalogRow property="tags" value={catalog.tags} />
-      </div>
-    </div>
-  )
-}
-
-const CatalogRow = ({
-  property,
-  value
-}: {
-  property: string
-  value: string
-}) => {
-  return (
-    <div className="border-b-1 flex pl-1 border-outline">
-      <div className="flex-1">{property}</div>
-      <div className="flex-1">{value}</div>
-    </div>
-  )
-}
-
-export default CatalogInfo
diff --git a/webapp/frontend/src/lib/apis.ts b/webapp/frontend/src/lib/apis.ts
index 1729c101a..6e7863713 100644
--- a/webapp/frontend/src/lib/apis.ts
+++ b/webapp/frontend/src/lib/apis.ts
@@ -21,14 +21,6 @@ class Apis {
     return data
   }
 
-  async getCatalog(catalogId: string, axiosConfig?: AxiosRequestConfig) {
-    const { data } = await axios.get<Catalog>(
-      `/api/catalog/${catalogId}`,
-      axiosConfig
-    )
-    return data
-  }
-
   async getIsus(options?: { limit: number }, axiosConfig?: AxiosRequestConfig) {
     const { data } = await axios.get<Isu[]>(`/api/isu`, {
       params: options,
@@ -133,20 +125,9 @@ export interface User {
 export interface Isu {
   jia_isu_uuid: string
   name: string
-  jia_catalog_id: string
   character: string
 }
 
-export interface Catalog {
-  jia_catalog_id: string
-  name: string
-  limit_weight: number
-  weight: number
-  size: string
-  maker: string
-  tags: string
-}
-
 export interface IsuLog {
   jia_isu_uuid: string
   timestamp: number
diff --git a/webapp/frontend/src/pages/IsuDetail.tsx b/webapp/frontend/src/pages/IsuDetail.tsx
index dff02dbb5..1b4e0ad1b 100644
--- a/webapp/frontend/src/pages/IsuDetail.tsx
+++ b/webapp/frontend/src/pages/IsuDetail.tsx
@@ -1,4 +1,3 @@
-import CatalogInfo from '../components/IsuDetail/Catalog'
 import MainInfo from '../components/IsuDetail/MainInfo'
 import Card from '../components/UI/Card'
 import NowLoading from '../components/UI/NowLoading'
@@ -18,9 +17,6 @@ const IsuDetail = ({ isu, setIsu }: Props) => {
       <Card>
         <MainInfo isu={isu} setIsu={setIsu} />
       </Card>
-      <Card>
-        <CatalogInfo isu={isu} />
-      </Card>
     </div>
   )
 }


Test patch: