Vista (intefaz y bd), esquema y endpoints de store agregados
This commit is contained in:
33
apps/web/app/dashboard/productos/[id]/page.tsx
Normal file
33
apps/web/app/dashboard/productos/[id]/page.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import PageContainer from '@/components/layout/page-container';
|
||||
import { getSurveyByIdAction } from '@/feactures/surveys/actions/surveys-actions';
|
||||
import { SurveyResponse } from '@/feactures/surveys/components/survey-response';
|
||||
|
||||
|
||||
|
||||
export default async function SurveyResponsePage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ id: string }>
|
||||
}) {
|
||||
const { id } = await params; // You can still destructure id from params
|
||||
|
||||
if (!id || id === '') {
|
||||
// Handle the case where no id is provided
|
||||
return null;
|
||||
}
|
||||
|
||||
// Call the function passing the dynamic id
|
||||
const data = await getSurveyByIdAction(Number(id));
|
||||
|
||||
if (!data?.data) {
|
||||
return <div>Encuesta no encontrada</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
<PageContainer>
|
||||
<div className="flex flex-1 flex-col space-y-4">
|
||||
<SurveyResponse survey={data?.data} />
|
||||
</div>
|
||||
</PageContainer>
|
||||
);
|
||||
}
|
||||
21
apps/web/app/dashboard/productos/page.tsx
Normal file
21
apps/web/app/dashboard/productos/page.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import PageContainer from '@/components/layout/page-container';
|
||||
import { SurveyList } from '@/feactures/inventory/components/products/product-list';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Productos - Fondemi',
|
||||
description: 'Listado de productos disponibles',
|
||||
};
|
||||
|
||||
export default function SurveysPage() {
|
||||
|
||||
return (
|
||||
<PageContainer>
|
||||
<div className="w-full">
|
||||
<h1 className="text-2xl font-bold mb-6">Productos Disponibles</h1>
|
||||
<SurveyList />
|
||||
</div>
|
||||
</PageContainer>
|
||||
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user