This commit is contained in:
2025-06-19 14:03:04 +05:00
parent daca480edf
commit 971cd8ff8e
30 changed files with 148 additions and 139 deletions
+3 -3
View File
@@ -3,15 +3,15 @@ import { and, desc, eq } from "drizzle-orm";
import db from "../../db";
import { commentsTable } from "../../db/schema";
export async function getComments(sessionId: string, userId: string) {
export async function getComments(sessionId: string, managerId: string) {
try {
const comments = await db.query.commentsTable.findMany({
where: and(
eq(commentsTable.sessionId, sessionId),
eq(commentsTable.ownerId, userId)
eq(commentsTable.managerId, managerId)
),
with: {
owner: {
manager: {
columns: {
fullname: true,
id: true,