Working on project front side.

This commit is contained in:
charles-gauthereau
2024-12-01 20:56:19 +01:00
parent b955d11613
commit 4851695c3e
12 changed files with 235 additions and 39 deletions
+20 -3
View File
@@ -1,6 +1,23 @@
import {SafeActionResult} from "next-safe-action";
import {ZodString} from "zod";
export type ServerActionResult<T> = { success: true; value: T; actionSuccess?: ActionSuccessMessage } | { success: false; actionError: ActionErrorMessage };
export type ServerActionResult<T> = { success: true; value?: T; actionSuccess?: ActionSuccessMessage } | {
success: false;
actionError?: ActionErrorMessage
};
export type ActionErrorMessage = { message?: string; status?: number; cause?: string; messageParams?: Record<string, string | number> };
export type ActionErrorMessage = {
message?: string;
status?: number;
cause?: string;
messageParams?: Record<string, string | number>
};
export type ActionSuccessMessage = { message?: string; messageParams?: Record<string, string | number> };
export type ActionSuccessMessage = { message?: string; messageParams?: Record<string, string | number> };
export type ActionResult<T> = SafeActionResult<string, ZodString, readonly [], {
formErrors: string[];
fieldErrors: {};
}, readonly [], ServerActionResult<T>, object>