mirror of
https://github.com/documenso/documenso.git
synced 2026-07-25 09:25:08 +10:00
fix: lint project (#2693)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { ServerResponse } from 'node:http';
|
||||
import { TRPCError } from '@trpc/server';
|
||||
import type { FetchHandlerOptions } from '@trpc/server/adapters/fetch';
|
||||
import type { ServerResponse } from 'node:http';
|
||||
import { type OpenApiRouter, createOpenApiNodeHttpHandler } from 'trpc-to-openapi';
|
||||
import { createOpenApiNodeHttpHandler, type OpenApiRouter } from 'trpc-to-openapi';
|
||||
|
||||
const CONTENT_TYPE_JSON = 'application/json';
|
||||
const CONTENT_TYPE_URLENCODED = 'application/x-www-form-urlencoded';
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { ErrorHandlerOptions } from '@trpc/server/unstable-core-do-not-import';
|
||||
|
||||
import { AppError, AppErrorCode } from '@documenso/lib/errors/app-error';
|
||||
import { logger } from '@documenso/lib/utils/logger';
|
||||
import type { ErrorHandlerOptions } from '@trpc/server/unstable-core-do-not-import';
|
||||
|
||||
import type { TrpcContext } from '../server/context';
|
||||
|
||||
@@ -16,8 +15,7 @@ export const handleTrpcRouterError = (
|
||||
|
||||
// Only log AppErrors that are explicitly set to 500 or the error code
|
||||
// is in the errorCodesToAlertOn list.
|
||||
const isLoggableAppError =
|
||||
isAppError && (appError.statusCode === 500 || errorCodesToAlertOn.includes(appError.code));
|
||||
const isLoggableAppError = isAppError && (appError.statusCode === 500 || errorCodesToAlertOn.includes(appError.code));
|
||||
|
||||
// Only log TRPC errors that are in the `errorCodesToAlertOn` list and is
|
||||
// not an AppError.
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { APP_DOCUMENT_UPLOAD_SIZE_LIMIT } from '@documenso/lib/constants/app';
|
||||
import { megabytesToBytes } from '@documenso/lib/universal/unit-convertions';
|
||||
import type { ZodRawShape } from 'zod';
|
||||
import z from 'zod';
|
||||
import { zfd } from 'zod-form-data';
|
||||
|
||||
import { APP_DOCUMENT_UPLOAD_SIZE_LIMIT } from '@documenso/lib/constants/app';
|
||||
import { megabytesToBytes } from '@documenso/lib/universal/unit-convertions';
|
||||
|
||||
/**
|
||||
* A `zfd.file()` schema with a max file size constraint based on
|
||||
* `APP_DOCUMENT_UPLOAD_SIZE_LIMIT`. Use this instead of bare `zfd.file()`
|
||||
|
||||
Reference in New Issue
Block a user