mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
feat: add get field endpoints (#1599)
This commit is contained in:
@ -47,15 +47,15 @@ export const recipientRouter = router({
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
getRecipient: authenticatedProcedure
|
||||
getDocumentRecipient: authenticatedProcedure
|
||||
.meta({
|
||||
openapi: {
|
||||
method: 'GET',
|
||||
path: '/recipient/{recipientId}',
|
||||
summary: 'Get recipient',
|
||||
path: '/document/recipient/{recipientId}',
|
||||
summary: 'Get document recipient',
|
||||
description:
|
||||
'Returns a single recipient. If you want to retrieve all the recipients for a document or template, use the "Get Document" or "Get Template" request.',
|
||||
tags: ['Document Recipients', 'Template Recipients'],
|
||||
'Returns a single recipient. If you want to retrieve all the recipients for a document, use the "Get Document" endpoint.',
|
||||
tags: ['Document Recipients'],
|
||||
},
|
||||
})
|
||||
.input(ZGetRecipientRequestSchema)
|
||||
@ -239,6 +239,33 @@ export const recipientRouter = router({
|
||||
});
|
||||
}),
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
getTemplateRecipient: authenticatedProcedure
|
||||
.meta({
|
||||
openapi: {
|
||||
method: 'GET',
|
||||
path: '/template/recipient/{recipientId}',
|
||||
summary: 'Get template recipient',
|
||||
description:
|
||||
'Returns a single recipient. If you want to retrieve all the recipients for a template, use the "Get Template" endpoint.',
|
||||
tags: ['Template Recipients'],
|
||||
},
|
||||
})
|
||||
.input(ZGetRecipientRequestSchema)
|
||||
.output(ZGetRecipientResponseSchema)
|
||||
.query(async ({ input, ctx }) => {
|
||||
const { teamId } = ctx;
|
||||
const { recipientId } = input;
|
||||
|
||||
return await getRecipientById({
|
||||
userId: ctx.user.id,
|
||||
teamId,
|
||||
recipientId,
|
||||
});
|
||||
}),
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user