You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
405 B
TypeScript
17 lines
405 B
TypeScript
export type FormState<F extends string = string> = {
|
|
ok: boolean;
|
|
error?: string;
|
|
fieldErrors?: Partial<Record<F, string[]>>;
|
|
values?: Partial<Record<F, string>>;
|
|
};
|
|
|
|
export type DeleteState = { ok: boolean; error?: string };
|
|
|
|
export function logActionError(
|
|
action: string,
|
|
context: Record<string, unknown>,
|
|
error: unknown,
|
|
): void {
|
|
console.error(`[${action}] gagal`, context, error);
|
|
}
|