This commit is contained in:
Delba de Oliveira
2023-10-26 10:21:39 -07:00
parent 36a9c02bc9
commit 1cab229e0f
4 changed files with 3 additions and 5 deletions

View File

@@ -1,2 +0,0 @@
# `openssl rand -base64 32`
AUTH_SECRET=

View File

@@ -31,7 +31,7 @@ export type State = {
amount?: string[];
status?: string[];
};
message?: string | undefined;
message?: string | null;
};
export async function createInvoice(prevState: State, formData: FormData) {

View File

@@ -13,7 +13,7 @@ import { createInvoice } from '@/app/lib/actions';
import { useFormState } from 'react-dom';
export default function Form({ customers }: { customers: CustomerField[] }) {
const initialState = { message: null, errors: [] };
const initialState = { message: null, errors: {} };
const [state, dispatch] = useFormState(createInvoice, initialState);
return (

View File

@@ -19,7 +19,7 @@ export default function EditInvoiceForm({
invoice: InvoiceForm;
customers: CustomerField[];
}) {
const initialState = { message: null, errors: [] };
const initialState = { message: null, errors: {} };
const [state, dispatch] = useFormState(updateInvoice, initialState);
return (