diff --git a/apps/envited.ascs.digital/common/database/queries/profiles.ts b/apps/envited.ascs.digital/common/database/queries/profiles.ts index 9fde5730..8a7f2e8f 100644 --- a/apps/envited.ascs.digital/common/database/queries/profiles.ts +++ b/apps/envited.ascs.digital/common/database/queries/profiles.ts @@ -20,7 +20,7 @@ export const maybeUpdatePublishedState = (db: DatabaseConnection) => async (data } export const getProfileBySlug = (db: DatabaseConnection) => async (slug: string) => - db.query.profile.findFirst({ + db.query.profile.findFirst({ where: eq(profile.slug, slug), with: { profilesToBusinessCategories: true, diff --git a/apps/envited.ascs.digital/common/serverActions/profiles/get.ts b/apps/envited.ascs.digital/common/serverActions/profiles/get.ts index bf554061..7453e3d1 100644 --- a/apps/envited.ascs.digital/common/serverActions/profiles/get.ts +++ b/apps/envited.ascs.digital/common/serverActions/profiles/get.ts @@ -22,8 +22,7 @@ export const _get = const session = await getServerSession() const connection = await db() const profile = await connection.getProfileBySlug(slug) - console.log('profile') - console.log(profile) + if (isNil(profile) || isEmpty(profile)) { throw notFoundError({ resource: 'profiles', resourceId: slug, userId: session?.user.id }) }