Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
fix: main page searching
Browse files Browse the repository at this point in the history
  • Loading branch information
BoYanZh committed May 7, 2024
1 parent d0cc784 commit 23bc1ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,8 @@ export interface SchemaUpsertMovie {
producer: string
/** @maxLength 255 */
rating_code: string
/** @maxLength 255 */
reviews: string
show_time: string
/** @maxLength 255 */
synopsis: string
/** @maxLength 255 */
title: string
Expand Down
10 changes: 9 additions & 1 deletion src/pages/Main/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ const Movie: React.FC<{ movie: SchemaMovie }> = ({ movie }) => {
<Card.Title>{movie.title}</Card.Title>
<Card.Text>
<p>Rating: {movie.rating_code}</p>
<p>
Date:{' '}
{new Date(movie.show_time).toLocaleDateString(undefined, {
year: 'numeric',
month: 'short',
day: 'numeric'
})}
</p>
<Card.Link href='#' onClick={handleShow}>
Watch Trailer
</Card.Link>
Expand Down Expand Up @@ -73,7 +81,7 @@ const RunningMovieList: React.FC<{
const { data, loading } = useRequest(
async () =>
Backend.movie.v1MoviesList({ running: true, search, category, showTime }),
{ refreshDeps: [search, category], debounceWait: 200 }
{ refreshDeps: [search, category, showTime], debounceWait: 200 }
)
return (
!loading && (data?.data.data ? <MovieList movies={data.data.data} /> : null)
Expand Down

0 comments on commit 23bc1ea

Please sign in to comment.