corregido errores de compilacion para next en web
This commit is contained in:
@@ -2,23 +2,32 @@ import PageContainer from '@/components/layout/page-container';
|
||||
import { getSurveyByIdAction } from '@/feactures/surveys/actions/surveys-actions';
|
||||
import { SurveyResponse } from '@/feactures/surveys/components/survey-response';
|
||||
|
||||
// La función ahora recibe 'params' con el parámetro dinámico 'id'
|
||||
export default async function SurveyResponsePage({ params }: { params: { id: string } }) {
|
||||
const { id } = await params; // Obtienes el id desde los params de la URL
|
||||
|
||||
|
||||
export default async function SurveyResponsePage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ id: string }>
|
||||
}) {
|
||||
const { id } = await params; // You can still destructure id from params
|
||||
|
||||
if (!id || id === '') {
|
||||
// Maneja el caso en el que no se proporciona un id
|
||||
// Handle the case where no id is provided
|
||||
return null;
|
||||
}
|
||||
|
||||
// Llamas a la función pasando el id dinámico
|
||||
// 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>
|
||||
<div className="flex flex-1 flex-col space-y-4">
|
||||
<SurveyResponse survey={data?.data} />
|
||||
</div>
|
||||
</PageContainer>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user