@@ -154,7 +154,7 @@ const getKeywordRank = async (
154154) : Promise < object > => {
155155 let keywords : KeywordInfo [ ] = [ ] ;
156156 let films : FilmInfo [ ] = [ ] ;
157- let ranks : Array < object > = [ ] ;
157+ let data : Array < object > = [ ] ;
158158 try {
159159 if ( year && month ) {
160160 //rank2
@@ -166,7 +166,7 @@ const getKeywordRank = async (
166166 } ) . sort ( { count : - 1 } ) ;
167167 for ( var i = 0 ; i < 8 ; i ++ ) {
168168 if ( all_keywords [ i ] ) {
169- ranks . push ( {
169+ data . push ( {
170170 content : all_keywords [ i ] . content ,
171171 category : all_keywords [ i ] . category ,
172172 count : all_keywords [ i ] . count ,
@@ -175,10 +175,6 @@ const getKeywordRank = async (
175175 }
176176 }
177177
178- const data = {
179- ranks,
180- } ;
181-
182178 return data ;
183179 } catch ( error ) {
184180 console . log ( error ) ;
@@ -194,17 +190,14 @@ const getKeywordByCategory = async (
194190) : Promise < object > => {
195191 let keywords : KeywordInfo [ ] = [ ] ;
196192 let films : FilmInfo [ ] = [ ] ;
197- let ranks : Array < object > = [ ] ;
193+ let data : Array < object > = [ ] ;
198194 try {
199195 if ( year && month && option ) {
200196 // rank3
201197 let images : String [ ] = [ ] ;
202- ranks = await getCategoryRank ( userId , year , month , option , 8 ) ;
198+ data = await getCategoryRank ( userId , year , month , option , 8 ) ;
203199 }
204200
205- const data = {
206- ranks,
207- } ;
208201
209202 return data ;
210203 } catch ( error ) {
0 commit comments