refactor(kependudukan): improve TypeScript types and clean up code
- Add proper TypeScript interfaces for seeder files - Rename MigrasiPendudukForm interface for consistency - Separate asal/tujuan fields in MigrasiPenduduk API based on jenis - Remove unnecessary eslint-disable comments - Add local type definitions for public kependudukan pages - Clean up unused imports (React, Flex, IconBuilding) - Improve type safety in form handlers (handleChangeText vs handleChangeSelect) - Add explicit type casting where needed to fix type errors Co-authored-by: Qwen Code Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -55,7 +55,7 @@ const migrasiPenduduk = proxy({
|
||||
},
|
||||
|
||||
findMany: {
|
||||
data: null as any[] | null,
|
||||
data: null as unknown[] | null,
|
||||
page: 1,
|
||||
totalPages: 1,
|
||||
loading: false,
|
||||
@@ -66,7 +66,7 @@ const migrasiPenduduk = proxy({
|
||||
migrasiPenduduk.findMany.search = search;
|
||||
|
||||
try {
|
||||
const query: any = { page, limit };
|
||||
const query: Record<string, string | number> = { page, limit };
|
||||
if (tahun) query.tahun = tahun;
|
||||
if (search) query.search = search;
|
||||
|
||||
@@ -90,7 +90,7 @@ const migrasiPenduduk = proxy({
|
||||
},
|
||||
|
||||
findUnique: {
|
||||
data: null as any | null,
|
||||
data: null as unknown | null,
|
||||
async load(id: string) {
|
||||
try {
|
||||
const res = await fetch(`/api/kependudukan/migrasipenduduk/${id}`);
|
||||
|
||||
Reference in New Issue
Block a user