File tree 3 files changed +7
-6
lines changed
3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -74,8 +74,6 @@ function Modal({
74
74
await recMany ( ) ;
75
75
} ;
76
76
77
- const recResult = result ( ) ;
78
-
79
77
function reset ( ) {
80
78
setTitle ( { } ) ;
81
79
onClose ( ) ;
@@ -130,7 +128,7 @@ function Modal({
130
128
< div className = "flex flex-col justify-center bg-[#ebf0f7]" >
131
129
< h1 className = "mt-2 text-lg font-bold text-center" > Recommendations</ h1 >
132
130
{ /* //button */ }
133
- < Recs results = { recResult } />
131
+ < Recs results = { result } />
134
132
</ div >
135
133
</ div >
136
134
) ;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ function Recs({ results }) {
6
6
const [ movieArray , setMovieArray ] = useState ( [ ] ) ;
7
7
8
8
useEffect ( ( ) => {
9
- handleResults ( results , setMovieArray ) ;
9
+ handleResults ( results ( ) , setMovieArray ) ;
10
10
} , [ ] ) ;
11
11
12
12
return (
Original file line number Diff line number Diff line change @@ -87,8 +87,11 @@ export default function Home({ results }) {
87
87
}
88
88
89
89
export async function getServerSideProps ( ) {
90
- let allMovies = await fetch ( "http://localhost:8080/all-movies" ) . then ( ( res ) =>
91
- res . json ( )
90
+ let allMovies = await fetch ( "http://localhost:8080/all-movies" ) . then (
91
+ ( res ) => {
92
+ if ( ! res . ok ) return [ ] ;
93
+ return res . json ( ) ;
94
+ }
92
95
) ;
93
96
94
97
return {
You can’t perform that action at this time.
0 commit comments