fix: refactor routers (#1523)

This commit is contained in:
David Nguyen
2024-12-10 16:11:20 +09:00
committed by GitHub
parent dd162205fa
commit fae9c0ca24
33 changed files with 1122 additions and 738 deletions

View File

@@ -4,18 +4,18 @@ import { DocumentSource, type Prisma } from '@documenso/prisma/client';
import { getDocumentWhereInput } from './get-document-by-id';
export interface DuplicateDocumentByIdOptions {
id: number;
documentId: number;
userId: number;
teamId?: number;
}
export const duplicateDocumentById = async ({
id,
documentId,
userId,
teamId,
}: DuplicateDocumentByIdOptions) => {
const documentWhereInput = await getDocumentWhereInput({
documentId: id,
documentId,
userId,
teamId,
});

View File

@@ -9,14 +9,14 @@ import { DocumentVisibility } from '../../types/document-visibility';
import { getTeamById } from '../team/get-team';
export type GetDocumentByIdOptions = {
id: number;
documentId: number;
userId: number;
teamId?: number;
};
export const getDocumentById = async ({ id, userId, teamId }: GetDocumentByIdOptions) => {
export const getDocumentById = async ({ documentId, userId, teamId }: GetDocumentByIdOptions) => {
const documentWhereInput = await getDocumentWhereInput({
documentId: id,
documentId,
userId,
teamId,
});

View File

@@ -4,18 +4,18 @@ import type { DocumentWithDetails } from '@documenso/prisma/types/document';
import { getDocumentWhereInput } from './get-document-by-id';
export type GetDocumentWithDetailsByIdOptions = {
id: number;
documentId: number;
userId: number;
teamId?: number;
};
export const getDocumentWithDetailsById = async ({
id,
documentId,
userId,
teamId,
}: GetDocumentWithDetailsByIdOptions): Promise<DocumentWithDetails> => {
const documentWhereInput = await getDocumentWhereInput({
documentId: id,
documentId,
userId,
teamId,
});