116116 {{ errorMessage }}
117117 </v-alert >
118118
119- <v-card-actions class =" pr-0 mt-4" >
119+ <v-card-actions class =" px-0 mt-4" >
120+ <v-btn
121+ color =" primary darken-1"
122+ variant =" text"
123+ @click.prevent =" fetchItem(page + 1)"
124+ >
125+ Skip
126+ </v-btn >
120127 <v-spacer ></v-spacer >
121128 <v-btn
122129 color =" primary darken-1"
@@ -158,6 +165,7 @@ export default {
158165 isOpen: false ,
159166 errorMessage: null ,
160167 menu: null ,
168+ page: 1 ,
161169 };
162170 },
163171 methods: {
@@ -169,9 +177,12 @@ export default {
169177 this .$logger .error (` Error fetching recommendations: ${ error} ` );
170178 }
171179 },
172- async fetchItem () {
180+ async fetchItem (page = 1 ) {
181+ if (this .currentItem && ! this .currentItem .pageInfo .hasNext ) {
182+ return this .onClose ();
183+ }
173184 try {
174- const response = await this .getRecommendations (1 , 1 );
185+ const response = await this .getRecommendations (page , 1 );
175186 if (response .data .recommendedMerge .entities ) {
176187 const recommendation = response .data .recommendedMerge .entities [0 ];
177188 this .currentItem = {
@@ -181,6 +192,7 @@ export default {
181192 pageInfo: response .data .recommendedMerge .pageInfo ,
182193 };
183194 this .count = this .currentItem .pageInfo .totalResults ;
195+ this .page = this .currentItem .pageInfo .page ;
184196 }
185197 } catch (error) {
186198 this .errorMessage = this .$getErrorMessage (error);
@@ -199,7 +211,7 @@ export default {
199211 if (! this .currentItem .pageInfo .hasNext ) {
200212 this .onClose ();
201213 } else {
202- this .fetchItem ();
214+ this .fetchItem (this . page );
203215 }
204216 } catch (error) {
205217 this .errorMessage = this .$getErrorMessage (error);
0 commit comments