diff --git a/app/attachment/[id]/not-found.tsx b/app/attachment/[id]/not-found.tsx index aad21c3..356320e 100644 --- a/app/attachment/[id]/not-found.tsx +++ b/app/attachment/[id]/not-found.tsx @@ -1,4 +1,6 @@ import { NotFoundPage } from '@/app/ui/NotFoundPage'; -export default () => -; \ No newline at end of file +const AttachmentNotFound = () => +; + +export default AttachmentNotFound; \ No newline at end of file diff --git a/app/bill/[id]/delete/not-found.tsx b/app/bill/[id]/delete/not-found.tsx index 483cd2e..6d8b8b0 100644 --- a/app/bill/[id]/delete/not-found.tsx +++ b/app/bill/[id]/delete/not-found.tsx @@ -1,4 +1,6 @@ import { NotFoundPage } from '@/app/ui/NotFoundPage'; -export default () => -; \ No newline at end of file +const BillNotFound = () => +; + +export default BillNotFound; \ No newline at end of file diff --git a/app/bill/[id]/edit/not-found.tsx b/app/bill/[id]/edit/not-found.tsx index 483cd2e..d9d84b1 100644 --- a/app/bill/[id]/edit/not-found.tsx +++ b/app/bill/[id]/edit/not-found.tsx @@ -1,4 +1,6 @@ import { NotFoundPage } from '@/app/ui/NotFoundPage'; -export default () => -; \ No newline at end of file +const BillNotFound = () => +; + +export default BillNotFound; diff --git a/app/bill/[id]/edit/page.tsx b/app/bill/[id]/edit/page.tsx index c528641..4f1dd58 100644 --- a/app/bill/[id]/edit/page.tsx +++ b/app/bill/[id]/edit/page.tsx @@ -1,8 +1,5 @@ -import { BillingLocation, Bill } from '@/app/lib/db-types'; import { fetchBillById } from '@/app/lib/actions/billActions'; -import clientPromise from '@/app/lib/mongodb'; import { BillEditForm } from '@/app/ui/BillEditForm'; -import { ObjectId } from 'mongodb'; import { notFound } from 'next/navigation'; export default async function Page({ params:{ id } }: { params: { id:string } }) { diff --git a/app/lib/actions/billActions.ts b/app/lib/actions/billActions.ts index e3b47a4..18dd7fd 100644 --- a/app/lib/actions/billActions.ts +++ b/app/lib/actions/billActions.ts @@ -110,12 +110,10 @@ const serializeAttachment = async (billAttachment: File | null) => { * @param formData form data * @returns */ -export const updateOrAddBill = withUser(async (user:AuthenticatedUser, locationId: string, billId?:string, prevState:State, formData: FormData) => { +export const updateOrAddBill = withUser(async (user:AuthenticatedUser, locationId: string, billId:string|undefined, prevState:State, formData: FormData) => { const { id: userId } = user; - const x = formData.get('payedAmount'); - const validatedFields = UpdateBill.safeParse({ billName: formData.get('billName'), billNotes: formData.get('billNotes'), diff --git a/app/lib/actions/locationActions.ts b/app/lib/actions/locationActions.ts index be93b0d..b19b9d5 100644 --- a/app/lib/actions/locationActions.ts +++ b/app/lib/actions/locationActions.ts @@ -33,7 +33,7 @@ const UpdateLocation = FormSchema.omit({ _id: true }); * @param formData form data * @returns */ -export const updateOrAddLocation = withUser(async (user:AuthenticatedUser, locationId?: string, yearMonth?: YearMonth, prevState:State, formData: FormData) => { +export const updateOrAddLocation = withUser(async (user:AuthenticatedUser, locationId: string | undefined, yearMonth: YearMonth | undefined, prevState:State, formData: FormData) => { const validatedFields = UpdateLocation.safeParse({ locationName: formData.get('locationName'), diff --git a/app/location/[id]/delete/not-found.tsx b/app/location/[id]/delete/not-found.tsx index 2e33623..1587224 100644 --- a/app/location/[id]/delete/not-found.tsx +++ b/app/location/[id]/delete/not-found.tsx @@ -1,4 +1,6 @@ import { NotFoundPage } from '@/app/ui/NotFoundPage'; -export default () => -; \ No newline at end of file +const BillingLocationNotFound = () => +; + +export default BillingLocationNotFound; \ No newline at end of file diff --git a/app/location/[id]/edit/not-found.tsx b/app/location/[id]/edit/not-found.tsx index 6d17c02..54c9f60 100644 --- a/app/location/[id]/edit/not-found.tsx +++ b/app/location/[id]/edit/not-found.tsx @@ -1,4 +1,6 @@ import { NotFoundPage } from '@/app/ui/NotFoundPage'; -export default () => -; \ No newline at end of file +const BillingLocationNotFound = () => +; + +export default BillingLocationNotFound; \ No newline at end of file diff --git a/app/location/[id]/edit/page.tsx b/app/location/[id]/edit/page.tsx index 4a6c6a8..b991b72 100644 --- a/app/location/[id]/edit/page.tsx +++ b/app/location/[id]/edit/page.tsx @@ -1,8 +1,3 @@ -import { BillingLocation, Bill } from '@/app/lib/db-types'; -import { fetchBillById } from '@/app/lib/actions/billActions'; -import clientPromise from '@/app/lib/mongodb'; -import { BillEditForm } from '@/app/ui/BillEditForm'; -import { ObjectId } from 'mongodb'; import { notFound } from 'next/navigation'; import { LocationEditForm } from '@/app/ui/LocationEditForm'; import { fetchLocationById } from '@/app/lib/actions/locationActions'; diff --git a/app/page.tsx b/app/page.tsx index 3f90a56..734b689 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -18,7 +18,7 @@ const getNextYearMonth = (yearMonth:YearMonth) => { } as YearMonth); } -export const Page = async () => { +const Page = async () => { const locations = await fetchAllLocations(); const availableYears = await fetchAvailableYears();