Jelajahi Sumber

change type definition

yuto-oweseek 4 tahun lalu
induk
melakukan
4cf1cc43db

+ 0 - 32
packages/app/src/components/SearchPage/SearchResultList.jsx

@@ -1,32 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-import SearchResultListItem from './SearchResultListItem';
-
-class SearchResultList extends React.Component {
-
-  render() {
-    return this.props.pages.map((page) => {
-      // TODO : send cetain  length of body (revisionBody) from elastisearch by adding some settings to the query and
-      //         when keyword is not in page content, display revisionBody.
-      // TASK : https://estoc.weseek.co.jp/redmine/issues/79606
-      return (
-        <SearchResultListItem
-          page={page}
-          onClickInvoked={this.props.onClickInvoked}
-          noLink
-        />
-      );
-    });
-  }
-
-}
-
-SearchResultList.propTypes = {
-  pages: PropTypes.array.isRequired,
-  deletionMode: PropTypes.bool.isRequired,
-  selectedPages: PropTypes.array.isRequired,
-  onClickInvoked: PropTypes.func,
-  onChangeInvoked: PropTypes.func,
-};
-
-export default SearchResultList;

+ 9 - 1
packages/app/src/components/SearchPage/SearchResultList.tsx

@@ -2,12 +2,20 @@ import React, { FC } from 'react';
 import SearchResultListItem from './SearchResultListItem';
 import { IPage } from '../../interfaces/page';
 
-export type ISearchedPage = IPage & {
+// TOOD: retrieve bookmark count and add it to the following type
+export type ISearchedPage = Omit<IPage, 'revision' | 'tags' | 'creator'> & {
   _id: string,
   snippet: string,
+  revision: string,
+  tags?: string[],
+  creator: string,
   lastUpdateUser: any,
+  seenUsers: string[],
+  liker: string[],
+  commentCount: number,
   elasticSearchResult: {
     snippet: string,
+    matchedPath: string,
   },
 };