Browse Source

🔧 Refactor taxonomies initialization

📦 Organize taxonomy data for categories and tags
🏡 Include stay categories with listing type
🌟 Add experiences categories with listing type
🚀 Ready for taxonomies integration
main
John Doe 1 year ago
parent
commit
defe5f64c7
  1. 42
      src/data/taxonomies.ts

42
src/data/taxonomies.ts

@ -0,0 +1,42 @@
import __taxonomies from "./jsons/__taxonomies.json";
import __stayTaxonomies from "./jsons/__stayTaxonomies.json";
import __experiencesTaxonomies from "./jsons/__experiencesTaxonomies.json";
import { TaxonomyType } from "./types";
import { Route } from "@/routers/types";
const DEMO_CATEGORIES: TaxonomyType[] = __taxonomies.map((item) => ({
...item,
taxonomy: "category",
href: item.href as Route,
}));
const DEMO_TAGS: TaxonomyType[] = __taxonomies.map((item) => ({
...item,
taxonomy: "tag",
href: item.href as Route,
}));
//
const DEMO_STAY_CATEGORIES: TaxonomyType[] = __stayTaxonomies.map((item) => ({
...item,
taxonomy: "category",
listingType: "stay",
href: item.href as Route,
}));
//
const DEMO_EXPERIENCES_CATEGORIES: TaxonomyType[] = __experiencesTaxonomies.map(
(item) => ({
...item,
taxonomy: "category",
listingType: "experiences",
href: item.href as Route,
})
);
export {
DEMO_CATEGORIES,
DEMO_TAGS,
DEMO_STAY_CATEGORIES,
DEMO_EXPERIENCES_CATEGORIES,
};
Loading…
Cancel
Save