BugFix: restored location forms
This commit is contained in:
6
app/[locale]/location/[id]/add/LocationAddPage.tsx
Normal file
6
app/[locale]/location/[id]/add/LocationAddPage.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
import { LocationEditForm } from '@/app/ui/LocationEditForm';
|
||||
import { YearMonth } from '@/app/lib/db-types';
|
||||
|
||||
export default async function LocationAddPage({ yearMonth }: { yearMonth:YearMonth }) {
|
||||
return (<LocationEditForm yearMonth={yearMonth} />);
|
||||
}
|
||||
11
app/[locale]/location/[id]/add/page.tsx
Normal file
11
app/[locale]/location/[id]/add/page.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import { parseYearMonth } from '@/app/lib/format';
|
||||
import LocationAddPage from './LocationAddPage';
|
||||
import { Main } from '@/app/ui/Main';
|
||||
|
||||
export default async function Page({ params:{ id } }: { params: { id:string } }) {
|
||||
return (
|
||||
<Main>
|
||||
<LocationAddPage yearMonth={ parseYearMonth(id) } />
|
||||
</Main>
|
||||
);
|
||||
}
|
||||
14
app/[locale]/location/[id]/delete/LocationDeletePage.tsx
Normal file
14
app/[locale]/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} />);
|
||||
}
|
||||
6
app/[locale]/location/[id]/delete/not-found.tsx
Normal file
6
app/[locale]/location/[id]/delete/not-found.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
import { NotFoundPage } from '@/app/ui/NotFoundPage';
|
||||
|
||||
const BillingLocationNotFound = () =>
|
||||
<NotFoundPage title="404 Billing Location Not Found" description="Could not find the requested Billing Location." />;
|
||||
|
||||
export default BillingLocationNotFound;
|
||||
19
app/[locale]/location/[id]/delete/page.tsx
Normal file
19
app/[locale]/location/[id]/delete/page.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import { notFound } from 'next/navigation';
|
||||
import { fetchLocationById } from '@/app/lib/actions/locationActions';
|
||||
import { LocationDeleteForm } from '@/app/ui/LocationDeleteForm';
|
||||
import { Main } from '@/app/ui/Main';
|
||||
|
||||
export default async function Page({ params:{ id } }: { params: { id:string } }) {
|
||||
|
||||
const location = await fetchLocationById(id);
|
||||
|
||||
if (!location) {
|
||||
return(notFound());
|
||||
}
|
||||
|
||||
return (
|
||||
<Main>
|
||||
<LocationDeleteForm location={location} />
|
||||
</Main>
|
||||
);
|
||||
}
|
||||
16
app/[locale]/location/[id]/edit/LocationEditPage.tsx
Normal file
16
app/[locale]/location/[id]/edit/LocationEditPage.tsx
Normal 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} />;
|
||||
|
||||
return (result);
|
||||
}
|
||||
6
app/[locale]/location/[id]/edit/not-found.tsx
Normal file
6
app/[locale]/location/[id]/edit/not-found.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
import { NotFoundPage } from '@/app/ui/NotFoundPage';
|
||||
|
||||
const BillingLocationNotFound = () =>
|
||||
<NotFoundPage title="404 Location Not Found" description="Could not find the requested Location." />;
|
||||
|
||||
export default BillingLocationNotFound;
|
||||
15
app/[locale]/location/[id]/edit/page.tsx
Normal file
15
app/[locale]/location/[id]/edit/page.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Suspense } from 'react';
|
||||
import LocationEditPage from './LocationEditPage';
|
||||
import { Main } from '@/app/ui/Main';
|
||||
import { LocationEditFormSkeleton } from '@/app/ui/LocationEditForm';
|
||||
|
||||
export default async function Page({ params:{ id } }: { params: { id:string } }) {
|
||||
|
||||
return (
|
||||
<Main>
|
||||
<Suspense fallback={<LocationEditFormSkeleton />}>
|
||||
<LocationEditPage locationId={id} />
|
||||
</Suspense>
|
||||
</Main>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user