This commit is contained in:
@@ -397,10 +397,10 @@ Unified Workflow Engine (Core Architecture)
|
||||
- **สถานะ:** Shared Service สำหรับจัดการ details fields
|
||||
- **หน้าที่:** Centralized service สำหรับ JSON details operations
|
||||
- **Methods:**
|
||||
- validateDetails(type: string, data: any): ValidationResult
|
||||
- transformDetails(input: any, targetVersion: string): any
|
||||
- sanitizeDetails(data: any): any
|
||||
- getDefaultDetails(type: string): any
|
||||
- validateDetails(type: string, data: Record<string, unknown>): ValidationResult
|
||||
- transformDetails(input: Record<string, unknown>, targetVersion: string): Record<string, unknown>
|
||||
- sanitizeDetails(data: Record<string, unknown>): Record<string, unknown>
|
||||
- getDefaultDetails(type: string): Record<string, unknown>
|
||||
|
||||
### **3.10 สถาปัตยกรรมระบบ (System Architecture)**
|
||||
|
||||
@@ -579,7 +579,7 @@ Backend (NestJS) ควรเป็น **Stateless** (ไม่เก็บส
|
||||
|
||||
```typescript
|
||||
// hooks/useAutoSaveForm.ts
|
||||
export const useAutoSaveForm = (formKey: string, defaultValues: any) => {
|
||||
export const useAutoSaveForm = <T extends Record<string, unknown>>(formKey: string, defaultValues: T) => {
|
||||
const { register, watch, setValue } = useForm({ defaultValues });
|
||||
|
||||
// Auto-save เมื่อ form เปลี่ยนแปลง
|
||||
|
||||
Reference in New Issue
Block a user