Skip to content

Commit

Permalink
Update link in sources table
Browse files Browse the repository at this point in the history
Signed-off-by: Olga Bulat <[email protected]>
  • Loading branch information
obulat committed Mar 3, 2024
1 parent 3bac3e9 commit f507e22
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions frontend/src/components/VSourcesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@
</template>

<script lang="ts">
import { computed, defineComponent, PropType, reactive } from "vue"
import { useContext } from "@nuxtjs/composition-api"
import { computed, defineComponent, type PropType, reactive } from "vue"
import { useProviderStore } from "~/stores/provider"
import { useGetLocaleFormattedNumber } from "~/composables/use-get-locale-formatted-number"
Expand All @@ -71,6 +69,7 @@ import type { SupportedMediaType } from "~/constants/media"
import type { MediaProvider } from "~/types/media-provider"
import { useFeatureFlagStore } from "~/stores/feature-flag"
import { useSearchStore } from "~/stores/search"
import TableSortIcon from "~/components/TableSortIcon.vue"
import VLink from "~/components/VLink.vue"
Expand All @@ -88,8 +87,6 @@ export default defineComponent({
},
},
setup(props) {
const { app } = useContext()
const sorting = reactive({
direction: "asc",
field: "display_name" as keyof Omit<MediaProvider, "logo_url">,
Expand Down Expand Up @@ -148,8 +145,16 @@ export default defineComponent({
const additionalSearchViews = computed(() => {
return featureFlagStore.isOn("additional_search_views")
})
const searchStore = useSearchStore()
const providerViewUrl = (provider: MediaProvider) => {
return app.localePath(`/${props.media}/source/${provider.source_name}`)
return searchStore.getCollectionPath({
type: props.media,
collectionParams: {
collection: "source",
source: provider.source_name,
},
})
}
return {
getLocaleFormattedNumber,
Expand Down

0 comments on commit f507e22

Please sign in to comment.