debug for build
This commit is contained in:
@@ -1,14 +1,14 @@
|
|||||||
import { NextResponse, NextRequest } from 'next/server';
|
import { NextResponse, NextRequest } from 'next/server';
|
||||||
import { cookies } from 'next/headers';
|
import { cookies } from 'next/headers';
|
||||||
import { generateProductsForCategory } from './data';
|
import { generateProductsForCategory } from './data';
|
||||||
import { productCategories } from '@/app/api/project_categories/data';
|
import { productCategoriesData } from '../../data';
|
||||||
|
|
||||||
export async function GET(request: NextRequest, context: any) {
|
export async function GET(request: NextRequest, context: any) {
|
||||||
const cookieStore = await cookies();
|
const cookieStore = await cookies();
|
||||||
const lang = cookieStore.get('locale')?.value || 'en';
|
const lang = cookieStore.get('locale')?.value || 'en';
|
||||||
|
|
||||||
const params = await context.params;
|
const params = await context.params;
|
||||||
const category = productCategories.find((cat) => cat.id === params.id);
|
const category = productCategoriesData.find((cat) => cat.id === params.id);
|
||||||
|
|
||||||
if (!category) {
|
if (!category) {
|
||||||
return NextResponse.json({ error: 'Not found' }, { status: 404 });
|
return NextResponse.json({ error: 'Not found' }, { status: 404 });
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
import { NextResponse } from 'next/server';
|
import { NextResponse } from 'next/server';
|
||||||
import { productCategoriesData } from '../product_categories/data';
|
import { productCategoriesData } from '../product_categories/data';
|
||||||
import { host } from '@/config';
|
import { host } from '@/config';
|
||||||
|
import { projects } from '../projects/data';
|
||||||
|
|
||||||
const pages = [
|
const pages = [
|
||||||
'/',
|
'/',
|
||||||
@@ -23,6 +24,7 @@ export async function GET() {
|
|||||||
(productCategory) => `/product-categories/${productCategory.id}`,
|
(productCategory) => `/product-categories/${productCategory.id}`,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
pages.push(...projects.map((project) => `/projects/${project.id}`));
|
||||||
|
|
||||||
const urls = pages.flatMap((page) =>
|
const urls = pages.flatMap((page) =>
|
||||||
locales.map((locale) => {
|
locales.map((locale) => {
|
||||||
|
|||||||
@@ -3,7 +3,11 @@ import Link from 'next/link';
|
|||||||
import { IProjectCardProps } from './project';
|
import { IProjectCardProps } from './project';
|
||||||
import { getProjects } from '@/services/projects';
|
import { getProjects } from '@/services/projects';
|
||||||
|
|
||||||
export default async function ProjectsGrid({ projects }) {
|
export default async function ProjectsGrid({
|
||||||
|
projects,
|
||||||
|
}: {
|
||||||
|
projects: IProjectCardProps[];
|
||||||
|
}) {
|
||||||
return (
|
return (
|
||||||
<div className="container mx-auto grid grid-cols-1 gap-6 px-4 pt-12 pb-0 md:grid-cols-2 md:py-28">
|
<div className="container mx-auto grid grid-cols-1 gap-6 px-4 pt-12 pb-0 md:grid-cols-2 md:py-28">
|
||||||
{projects.map((project, index) => (
|
{projects.map((project, index) => (
|
||||||
|
|||||||
Reference in New Issue
Block a user