diff --git a/app/actions.ts b/app/actions.ts index 4a72bfe..a075689 100644 --- a/app/actions.ts +++ b/app/actions.ts @@ -117,6 +117,7 @@ export async function getLocationBySlug(slug: string) { } } + export async function getProjectsByService(serviceName: string) { try { // Search projects where the serviceName is in the title or categories @@ -133,3 +134,21 @@ export async function getProjectsByService(serviceName: string) { return []; } } + +export async function getLocations() { + try { + return await sql`SELECT * FROM locations ORDER BY name ASC`; + } catch (error) { + console.error('Error fetching locations:', error); + return []; + } +} + +export async function getServices() { + try { + return await sql`SELECT * FROM services ORDER BY display_order ASC`; + } catch (error) { + console.error('Error fetching services:', error); + return []; + } +}