mirror of
https://github.com/documenso/documenso.git
synced 2026-07-26 01:45:08 +10:00
feat: upload template via API (#1842)
Allow users to upload templates via both v1 and v2 APIs. Similar to uploading documents.
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import { initContract } from '@ts-rest/core';
|
||||
|
||||
import {
|
||||
ZCreateTemplateV2RequestSchema,
|
||||
ZCreateTemplateV2ResponseSchema,
|
||||
} from '@documenso/trpc/server/template-router/schema';
|
||||
|
||||
import {
|
||||
ZAuthorizationHeadersSchema,
|
||||
ZCreateDocumentFromTemplateMutationResponseSchema,
|
||||
@@ -87,6 +92,18 @@ export const ApiContractV1 = c.router(
|
||||
summary: 'Upload a new document and get a presigned URL',
|
||||
},
|
||||
|
||||
createTemplate: {
|
||||
method: 'POST',
|
||||
path: '/api/v1/templates',
|
||||
body: ZCreateTemplateV2RequestSchema,
|
||||
responses: {
|
||||
200: ZCreateTemplateV2ResponseSchema,
|
||||
401: ZUnsuccessfulResponseSchema,
|
||||
404: ZUnsuccessfulResponseSchema,
|
||||
},
|
||||
summary: 'Create a new template and get a presigned URL',
|
||||
},
|
||||
|
||||
deleteTemplate: {
|
||||
method: 'DELETE',
|
||||
path: '/api/v1/templates/:id',
|
||||
|
||||
Reference in New Issue
Block a user