fix: use correct column names for stops (cutoff_date not cutoff_time) and replace mock Supabase with real pool queries in stops detail/new pages
Deploy to route.crispygoat.com / deploy (push) Successful in 4m5s

This commit is contained in:
Tyler
2026-06-10 13:48:30 -06:00
parent 24cf9a7261
commit b5f7252ac0
4 changed files with 110 additions and 63 deletions
+3 -3
View File
@@ -49,7 +49,7 @@ export default async function AdminStopsPage({ searchParams }: PageProps) {
totalCount = parseInt(countResult.rows[0]?.count ?? "0", 10);
// Get paginated stops
const { rows } = await pool.query<Stop& { brand_name: string }>(`
const { rows } = await pool.query<Stop & { brand_name: string } & { cutoff_date: string | null }>(`
SELECT
s.id,
s.city,
@@ -61,7 +61,7 @@ export default async function AdminStopsPage({ searchParams }: PageProps) {
s.brand_id,
s.address,
s.zip,
s.cutoff_time,
s.cutoff_date,
b.name as brand_name
FROM stops s
LEFT JOIN brands b ON b.id = s.brand_id
@@ -82,7 +82,7 @@ export default async function AdminStopsPage({ searchParams }: PageProps) {
brand_id: r.brand_id,
address: r.address,
zip: r.zip,
cutoff_time: r.cutoff_time,
cutoff_time: r.cutoff_date,
status: r.status ?? "active",
brands: r.brand_name ? { name: r.brand_name } : { name: "" },
}));