From fb46b09e4f6ceb90e9a76f63bfc748c041736c4b Mon Sep 17 00:00:00 2001 From: Catalin Pit Date: Wed, 20 Dec 2023 12:47:46 +0200 Subject: [PATCH] chore: small changes --- apps/web/src/pages/api/v1/[...ts-rest].tsx | 8 ++++---- packages/trpc/api-contract/contract.ts | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/web/src/pages/api/v1/[...ts-rest].tsx b/apps/web/src/pages/api/v1/[...ts-rest].tsx index 18a0b3001..1c645a3ea 100644 --- a/apps/web/src/pages/api/v1/[...ts-rest].tsx +++ b/apps/web/src/pages/api/v1/[...ts-rest].tsx @@ -67,7 +67,7 @@ const router = createNextRoute(contract, { return { status: 404, body: { - message: 'Document not found', + message: e.message ?? 'Document not found', }, }; } @@ -106,7 +106,7 @@ const router = createNextRoute(contract, { return { status: 404, body: { - message: 'Document not found', + message: e.message ?? 'Document not found', }, }; } @@ -128,7 +128,7 @@ const router = createNextRoute(contract, { return { status: 404, body: { - message: 'An error has occured while uploading the file', + message: e.message ?? 'An error has occured while uploading the file', }, }; } @@ -219,7 +219,7 @@ const router = createNextRoute(contract, { return { status: 500, body: { - message: 'An error occurred while uploading your document.', + message: e.message ?? 'An error has occured while sending the document for signing', }, }; } diff --git a/packages/trpc/api-contract/contract.ts b/packages/trpc/api-contract/contract.ts index 8e8f7b9bd..5f28a0c63 100644 --- a/packages/trpc/api-contract/contract.ts +++ b/packages/trpc/api-contract/contract.ts @@ -51,13 +51,14 @@ export const contract = c.router( }, sendDocumentForSigning: { method: 'PATCH', - path: '/documents/:id/send-for-signing', + path: '/documents/:id/send', body: SendDocumentForSigningMutationSchema, responses: { 200: SuccessfulSigningResponseSchema, 400: UnsuccessfulResponseSchema, 401: UnsuccessfulResponseSchema, 404: UnsuccessfulResponseSchema, + 500: UnsuccessfulResponseSchema, }, summary: 'Send a document for signing', },