fix: resolve typecheck errors in seed scripts

Add non-null assertions for array indexing in prisma/seed.ts and
scripts/seed-districts.ts to satisfy strict TypeScript checks.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-08 12:45:17 +07:00
parent 2502aa69b7
commit 0c227b6b01
2 changed files with 3 additions and 3 deletions

View File

@@ -253,8 +253,8 @@ async function seedProperties(users: Awaited<ReturnType<typeof seedUsers>>) {
const agents = await prisma.agent.findMany();
for (let i = 0; i < sampleProperties.length; i++) {
const p = sampleProperties[i];
const agent = agents[i % agents.length];
const p = sampleProperties[i]!;
const agent = agents[i % agents.length]!
const property = await prisma.$executeRaw`
INSERT INTO "Property" (

View File

@@ -257,7 +257,7 @@ async function seedDistrictProperties() {
for (const { district, wards } of districts) {
const ward = wards[0];
const template = PROPERTY_TEMPLATES[created % PROPERTY_TEMPLATES.length];
const template = PROPERTY_TEMPLATES[created % PROPERTY_TEMPLATES.length]!;
const loc = coords[district] ?? { lat: 10.0, lng: 106.0 };
// Small random offset so each property has unique coords
const jitterLat = (Math.random() - 0.5) * 0.005;