File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -426,9 +426,12 @@ export default {
426426 }),
427427 max_upcoming_hours: 1 ,
428428 };
429+ return async (offset : any , limit : any ) => {
430+ let res = null ;
431+ // Handle backend query depending on page
429432 if (this .isFavPage ) {
430- return async ( offset , limit ) => {
431- const res = await backendApi
433+ // Favourites Page
434+ res = await backendApi
432435 .favoritesVideos (this .$store .state .userdata .jwt , {
433436 ... query ,
434437 limit ,
@@ -439,18 +442,18 @@ export default {
439442 this .$store .dispatch (" loginVerify" , { bounceToLogin: true }); // check if the user is actually logged in.
440443 throw err ;
441444 });
442- return res .data ;
443- };
444- }
445- // home page function
446- return async (offset , limit ) => {
447- const res = await backendApi .videos ({
445+ } else {
446+ // Home Page
447+ res = await backendApi
448+ .videos ({
448449 ... query ,
449450 org: this .$store .state .currentOrg .name ,
450451 limit ,
451452 offset ,
452453 });
453- return res .data ;
454+ }
455+
456+ return res ?.data ;
454457 };
455458 },
456459 },
You can’t perform that action at this time.
0 commit comments