Improve service listings and fix user association errors in the system

Fixes service type lookup and userId association for professional services.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: c5f0c281-8dd8-4846-b452-4a07bcd21062
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/9777c70b-fc38-4831-8d6b-78dfffe041b0/c7f781e6-1a7d-4e21-8939-c74aab1e3cd7.jpg
This commit is contained in:
ghaddaditw
2025-06-08 08:20:16 +00:00
parent a46b2a1825
commit a16fca481c
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -318,6 +318,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
);
res.json(services);
} catch (error) {
console.error('Professional services error:', error);
res.status(500).json({ error: 'Failed to fetch professional services' });
}
});
+2 -2
View File
@@ -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;
}