Merge pull request #2121 from rommapp/romm-2109

[ROMM-2109] Fix clicking on meta pills, use correct filters
This commit is contained in:
Georges-Antoine Assi
2025-07-21 13:23:03 -04:00
committed by GitHub
2 changed files with 15 additions and 15 deletions

View File

@@ -20,20 +20,20 @@ const show = ref(false);
const carousel = ref(0);
const router = useRouter();
const filters = [
{ key: "regions", path: "regions", name: t("rom.regions") },
{ key: "languages", path: "languages", name: t("rom.languages") },
{ key: "genres", path: "metadatum.genres", name: t("rom.genres") },
{ key: "region", path: "regions", name: t("rom.regions") },
{ key: "language", path: "languages", name: t("rom.languages") },
{ key: "genre", path: "metadatum.genres", name: t("rom.genres") },
{
key: "franchises",
key: "franchise",
path: "metadatum.franchises",
name: t("rom.franchises"),
},
{
key: "collections",
key: "collection",
path: "metadatum.collections",
name: t("rom.collections"),
},
{ key: "companies", path: "metadatum.companies", name: t("rom.companies") },
{ key: "company", path: "metadatum.companies", name: t("rom.companies") },
] as const;
const dataSources = computed(() => {
@@ -94,7 +94,7 @@ const coverImageSource = computed(() => {
function onFilterClick(filter: FilterType, value: string) {
router.push({
name: "search",
query: { search: "", filter, value },
query: { [filter]: value },
});
}
</script>
@@ -170,7 +170,7 @@ function onFilterClick(filter: FilterType, value: string) {
<v-img
v-for="value in rom.igdb_metadata.age_ratings"
:key="value.rating"
@click="onFilterClick('age_ratings', value.rating)"
@click="onFilterClick('ageRating', value.rating)"
:src="value.rating_cover_url"
height="50"
width="50"

View File

@@ -5,14 +5,14 @@ import { defineStore } from "pinia";
export type Platform = PlatformSchema;
export type FilterType =
| "genres"
| "franchises"
| "collections"
| "companies"
| "age_ratings"
| "genre"
| "franchise"
| "collection"
| "company"
| "ageRating"
| "status"
| "regions"
| "languages";
| "region"
| "language";
const defaultFilterState = {
activeFilterDrawer: false,