Skip to content

Commit

Permalink
Edit category page, YMCore
Browse files Browse the repository at this point in the history
Redirect to android
YMCore
  • Loading branch information
seelentov committed Jul 17, 2024
1 parent 752a900 commit 9f03662
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/[category]/[service]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { getItemByFilter } from "@/core/api/getItemsByFilter";
import { API_URL } from "@/core/config/api.config";
import { parseObjToQuerytsts } from "@/core/utils/api/parseObjToQuery";
import { Metadata } from "next";
import { notFound } from "next/navigation";
import { notFound, redirect } from "next/navigation";


export async function generateMetadata(
Expand Down
7 changes: 6 additions & 1 deletion src/app/[category]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { baseFetch } from '@/core/api/baseFetch';
import { getItemByFilter, getItemsByFilter } from '@/core/api/getItemsByFilter';
import { API_URL } from '@/core/config/api.config';
import { Metadata } from 'next';
import { notFound } from 'next/navigation';
import { notFound, redirect } from 'next/navigation';

export async function generateMetadata(
{ params }: ICategoryPage
Expand Down Expand Up @@ -54,6 +54,11 @@ export default async function Category({ params }: ICategoryPage) {
['populate', 'mobileExample']
])

if (params.category === "mobile") {
redirect("/mobile/android");
}


const serializedServices: IService[] = services.map(item => {
return { ...item, href: `/${params.category}/${item.href}` }
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function RootLayout({
return (
<html lang="ru">
<body className={inter.className}>
<YMCore metrik_id={97828066} />
<YMCore metrik_id={97851645} />
<Header />
<main className="wrapper">
{children}
Expand Down

0 comments on commit 9f03662

Please sign in to comment.