Added suspense to LocationAddPage and LocationDetelePage
This commit is contained in:
14
app/location/[id]/delete/LocationDeletePage.tsx
Normal file
14
app/location/[id]/delete/LocationDeletePage.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { notFound } from 'next/navigation';
|
||||
import { fetchLocationById } from '@/app/lib/actions/locationActions';
|
||||
import { LocationDeleteForm } from '@/app/ui/LocationDeleteForm';
|
||||
|
||||
export const LocationDeletePage = async ({ locationId }: { locationId:string }) => {
|
||||
|
||||
const location = await fetchLocationById(locationId);
|
||||
|
||||
if (!location) {
|
||||
return(notFound());
|
||||
}
|
||||
|
||||
return (<LocationDeleteForm location={location} />);
|
||||
}
|
||||
Reference in New Issue
Block a user