added vendors table

This commit is contained in:
2026-01-27 12:23:59 -05:00
parent ecd7182153
commit 3aa9b6f325
20 changed files with 1058 additions and 5 deletions

View File

@@ -0,0 +1,21 @@
// lib/helper/fetchVendors.ts
import { Vendor } from '@prisma/client'
export interface VendorWithAddress extends Vendor {
address: {
street: string
city: string
state: string
zip: number
}
}
export async function fetchVendorsClient(): Promise<VendorWithAddress[]> {
const res = await fetch('/api/vendors/fetch')
if (!res.ok) {
throw new Error('Failed to fetch vendors')
}
return res.json()
}