( apiBase: string, headers: Record<string, string>, params: Record<string, unknown>, signal?: AbortSignal )
| 615 | } |
| 616 | |
| 617 | async function handleListRecipients( |
| 618 | apiBase: string, |
| 619 | headers: Record<string, string>, |
| 620 | params: Record<string, unknown>, |
| 621 | signal?: AbortSignal |
| 622 | ) { |
| 623 | const { envelopeId } = params |
| 624 | if (!envelopeId) { |
| 625 | return NextResponse.json({ success: false, error: 'envelopeId is required' }, { status: 400 }) |
| 626 | } |
| 627 | |
| 628 | const response = await fetchDocusign( |
| 629 | `${apiBase}/envelopes/${(envelopeId as string).trim()}/recipients`, |
| 630 | { |
| 631 | headers, |
| 632 | }, |
| 633 | signal |
| 634 | ) |
| 635 | const data = await readDocusignJson(response, 'DocuSign recipients response') |
| 636 | |
| 637 | if (!response.ok) { |
| 638 | return NextResponse.json( |
| 639 | { success: false, error: docusignError(data, 'Failed to list recipients') }, |
| 640 | { status: response.status } |
| 641 | ) |
| 642 | } |
| 643 | |
| 644 | return NextResponse.json(data) |
| 645 | } |
no test coverage detected