Skip to content

Commit

Permalink
component: ConnectedVideoList: getLoadFn: handle collabs
Browse files Browse the repository at this point in the history
  • Loading branch information
INCENDE committed Sep 17, 2023
1 parent 014391b commit 810ddf2
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/components/video/ConnectedVideoList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ export default {
return async (offset: any, limit: any) => {
let res = null;
// Handle backend query depending on page
if (this.isFavPage) {
if (this.isFavPage) {
// Favourites Page
res = await backendApi
.favoritesVideos(this.$store.state.userdata.jwt, {
Expand All @@ -446,13 +446,19 @@ export default {
// Home Page
res = await backendApi
.videos({
...query,
org: this.$store.state.currentOrg.name,
limit,
offset,
});
...query,
org: this.$store.state.currentOrg.name,
limit,
offset,
});
}
// Handle collab tab
if (this.tab === this.Tabs.COLLABS) {
res.data.items = res.data.items.filter(
// Filter only for videos with mentions (collabs)
(obj) => (Array.isArray(obj.mentions) && obj.mentions.length > 0),
);
}
return res?.data;
};
},
Expand Down

0 comments on commit 810ddf2

Please sign in to comment.