Skip to content

Commit

Permalink
merge logic realId
Browse files Browse the repository at this point in the history
  • Loading branch information
tachibana-shin committed Nov 19, 2022
1 parent a9eca0e commit 6374768
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/pages/phim/_season.vue
Expand Up @@ -464,6 +464,7 @@ import { computed, reactive, ref, shallowRef, watch, watchEffect } from "vue"
import { useI18n } from "vue-i18n"
import { useRequest } from "vue-request"
import { RouterLink, useRoute, useRouter } from "vue-router"
import { getRealSeasonId } from "src/logic/getRealSeasonId"
import type {
ResponseDataSeasonError,
Expand All @@ -490,11 +491,7 @@ const currentMetaSeason = computed(() => {
const realIdCurrentSeason = computed(() => {
if (!currentSeason.value) return
const lastIndexDolar = currentSeason.value.lastIndexOf("$")
if (lastIndexDolar === -1) return currentSeason.value
return currentSeason.value.slice(0, lastIndexDolar)
return getRealSeasonId(currentSeason.value)
})
const { data, run, error, loading } = useRequest(
Expand Down Expand Up @@ -608,9 +605,7 @@ async function fetchSeason(season: string) {
try {
console.log("fetch chaps on season")
const lastIndexDolar = season.lastIndexOf("$")
const realIdSeason =
lastIndexDolar === -1 ? season : season.slice(0, lastIndexDolar)
const realIdSeason =getRealSeasonId(season)
const response = await PhimIdChap(realIdSeason)
Expand Down

0 comments on commit 6374768

Please sign in to comment.