<suspense> added to LocationEditPage

This commit is contained in:
2024-02-06 14:16:31 +01:00
parent 7f08349688
commit cf97b3d4b5
3 changed files with 84 additions and 53 deletions

View File

@@ -0,0 +1,16 @@
import { notFound } from 'next/navigation';
import { LocationEditForm } from '@/app/ui/LocationEditForm';
import { fetchLocationById } from '@/app/lib/actions/locationActions';
export default async function LocationEditPage({ locationId }: { locationId:string }) {
const location = await fetchLocationById(locationId);
if (!location) {
return(notFound());
}
const result = <LocationEditForm location={location} yearMonth={location.yearMonth} />;
return (result);
}