a14bb5e17d
Use sql\`count(*)::int\` instead of selecting appointments.id, which was causing TS2339 under noUncheckedIndexedAccess (arr[0] is T | undefined). Import sql from @groombook/db. Use countRow?.count ?? 0 to stay noUncheckedIndexedAccess-safe. Matches the working implementation in apps/api/src/routes/pets.ts:365. Co-Authored-By: Paperclip <noreply@paperclip.ing>