upd
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user