From 6f57882bc7cf4c757001ff0ab12a01706c9ea708 Mon Sep 17 00:00:00 2001 From: Zoia <43918051+zizi62@users.noreply.github.com> Date: Fri, 27 Nov 2020 08:09:28 -0500 Subject: [PATCH] Ott 590 match profile videos no track id# (#231) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 🎸 OTT-590 added video filter by abc№1 * feat: 🎸 OTT-590 fix abs => abc Co-authored-by: Zoia --- src/features/MatchPage/hooks/useVideoData.tsx | 4 +++- src/requests/getVideos.tsx | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/features/MatchPage/hooks/useVideoData.tsx b/src/features/MatchPage/hooks/useVideoData.tsx index f1da2696..7dca18f3 100644 --- a/src/features/MatchPage/hooks/useVideoData.tsx +++ b/src/features/MatchPage/hooks/useVideoData.tsx @@ -2,6 +2,7 @@ import { useEffect, useState } from 'react' import isNull from 'lodash/isNull' import isEmpty from 'lodash/isEmpty' +import filter from 'lodash/filter' import type { LiveVideos, Videos } from 'requests' import { getLiveVideos, getVideos } from 'requests' @@ -21,7 +22,8 @@ export const useVideoData = () => { const live = await getLiveVideos(sportType, matchId) if (isNull(live) || isEmpty(live)) { const videosResponse = await getVideos(sportType, matchId) - setVideos(videosResponse) + const filteredVideosResponseByAbc = filter(videosResponse, (vid) => vid.abc !== 1) + setVideos(filteredVideosResponseByAbc) } else { setLiveVideos(live) } diff --git a/src/requests/getVideos.tsx b/src/requests/getVideos.tsx index e503737d..9c7ba720 100644 --- a/src/requests/getVideos.tsx +++ b/src/requests/getVideos.tsx @@ -2,6 +2,7 @@ import { API_ROOT, SportTypes } from 'config' import { callApi } from 'helpers' type Video = { + abc: number, duration: number, match_id: number, name: string,