diff --git a/apps/api/src/db/seed.ts b/apps/api/src/db/seed.ts index 77f6709..2ff67bf 100644 --- a/apps/api/src/db/seed.ts +++ b/apps/api/src/db/seed.ts @@ -94,11 +94,6 @@ function pick(arr: T[]): T { return arr[Math.floor(rand() * arr.length)]!; } -/** Return n distinct random elements from an array. */ -function pickN(arr: T[], n: number): T[] { - const shuffled = [...arr].sort(() => rand() - 0.5); - return shuffled.slice(0, n); -} function randInt(min: number, max: number): number { return Math.floor(rand() * (max - min + 1)) + min; @@ -1105,7 +1100,7 @@ async function seed() { const groomer = pick(groomers); const bather = bathers.length > 0 && rand() < 0.6 ? pick(bathers) : null; - let startTime = randDate(appointmentsBackDate, now); + const startTime = randDate(appointmentsBackDate, now); startTime.setHours(randInt(8, 16), pick([0, 15, 30, 45]), 0, 0); const endTime = new Date(startTime.getTime() + svc.dur * 60 * 1000); const effectivePrice = svc.price;