diff --git a/server/routes.ts b/server/routes.ts index 395f192..0d61af7 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -318,6 +318,7 @@ export async function registerRoutes(app: Express): Promise { ); res.json(services); } catch (error) { + console.error('Professional services error:', error); res.status(500).json({ error: 'Failed to fetch professional services' }); } }); diff --git a/server/storage.ts b/server/storage.ts index e97a4f7..25ab012 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -485,7 +485,7 @@ export class DatabaseStorage implements IStorage { .where(eq(professionalServices.isActive, true)); if (type) { - query = query.where(eq(professionalServices.type, type)); + query = query.where(eq(professionalServices.serviceType, type)); } if (location) { @@ -499,7 +499,7 @@ export class DatabaseStorage implements IStorage { const [updated] = await db .update(professionalServices) .set({ ...updates, updatedAt: new Date() }) - .where(and(eq(professionalServices.id, id), eq(professionalServices.providerId, userId))) + .where(and(eq(professionalServices.id, id), eq(professionalServices.userId, userId))) .returning(); return updated || undefined; }