Ott 590 match profile videos no track id# (#231)

* feat: 🎸 OTT-590

added video filter by abc№1

* feat: 🎸 OTT-590

fix abs => abc

Co-authored-by: Zoia <zizi2405@yandex.ru>
keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
Zoia 5 years ago committed by GitHub
parent 188adc38d8
commit 6f57882bc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/features/MatchPage/hooks/useVideoData.tsx
  2. 1
      src/requests/getVideos.tsx

@ -2,6 +2,7 @@ import { useEffect, useState } from 'react'
import isNull from 'lodash/isNull' import isNull from 'lodash/isNull'
import isEmpty from 'lodash/isEmpty' import isEmpty from 'lodash/isEmpty'
import filter from 'lodash/filter'
import type { LiveVideos, Videos } from 'requests' import type { LiveVideos, Videos } from 'requests'
import { getLiveVideos, getVideos } from 'requests' import { getLiveVideos, getVideos } from 'requests'
@ -21,7 +22,8 @@ export const useVideoData = () => {
const live = await getLiveVideos(sportType, matchId) const live = await getLiveVideos(sportType, matchId)
if (isNull(live) || isEmpty(live)) { if (isNull(live) || isEmpty(live)) {
const videosResponse = await getVideos(sportType, matchId) const videosResponse = await getVideos(sportType, matchId)
setVideos(videosResponse) const filteredVideosResponseByAbc = filter(videosResponse, (vid) => vid.abc !== 1)
setVideos(filteredVideosResponseByAbc)
} else { } else {
setLiveVideos(live) setLiveVideos(live)
} }

@ -2,6 +2,7 @@ import { API_ROOT, SportTypes } from 'config'
import { callApi } from 'helpers' import { callApi } from 'helpers'
type Video = { type Video = {
abc: number,
duration: number, duration: number,
match_id: number, match_id: number,
name: string, name: string,

Loading…
Cancel
Save