mirror of
https://github.com/rommapp/romm.git
synced 2026-12-02 18:18:47 +01:00
Merge pull request #2121 from rommapp/romm-2109
[ROMM-2109] Fix clicking on meta pills, use correct filters
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user