fix: merge conflicts

This commit is contained in:
Ephraim Atta-Duncan
2025-06-19 15:16:16 +00:00
750 changed files with 46465 additions and 29408 deletions

View File

@ -10,6 +10,7 @@ import type { TimePeriod } from '@documenso/ui/primitives/data-table/utils/time-
import { DocumentVisibility } from '../../types/document-visibility';
import { type FindResultResponse } from '../../types/search-params';
import { maskRecipientTokensForDocument } from '../../utils/mask-recipient-tokens-for-document';
import { getTeamById } from '../team/get-team';
export type FindDocumentsOptions = {
userId: number;
@ -52,32 +53,15 @@ export const findDocuments = async ({
let team = null;
if (teamId !== undefined) {
team = await prisma.team.findFirstOrThrow({
where: {
id: teamId,
members: {
some: {
userId,
},
},
},
include: {
teamEmail: true,
members: {
where: {
userId,
},
select: {
role: true,
},
},
},
team = await getTeamById({
userId,
teamId,
});
}
const orderByColumn = orderBy?.column ?? 'createdAt';
const orderByDirection = orderBy?.direction ?? 'desc';
const teamMemberRole = team?.members[0].role ?? null;
const teamMemberRole = team?.currentTeamRole ?? null;
const searchFilter: Prisma.DocumentWhereInput = {
OR: [
@ -370,7 +354,6 @@ const findDocumentsFilter = (
OR: [
{
userId: user.id,
teamId: null,
folderId: folderId,
},
{
@ -409,14 +392,12 @@ const findDocumentsFilter = (
}))
.with(ExtendedDocumentStatus.DRAFT, () => ({
userId: user.id,
teamId: null,
status: ExtendedDocumentStatus.DRAFT,
}))
.with(ExtendedDocumentStatus.PENDING, () => ({
OR: [
{
userId: user.id,
teamId: null,
status: ExtendedDocumentStatus.PENDING,
folderId: folderId,
},
@ -439,7 +420,6 @@ const findDocumentsFilter = (
OR: [
{
userId: user.id,
teamId: null,
status: ExtendedDocumentStatus.COMPLETED,
folderId: folderId,
},
@ -458,7 +438,6 @@ const findDocumentsFilter = (
OR: [
{
userId: user.id,
teamId: null,
status: ExtendedDocumentStatus.REJECTED,
folderId: folderId,
},