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:
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user