Files
pn-new-crm/src/app/api/v1/documents/[id]/signers/route.ts

17 lines
529 B
TypeScript
Raw Normal View History

import { NextResponse } from 'next/server';
import { withAuth, withPermission } from '@/lib/api/helpers';
import { errorResponse } from '@/lib/errors';
import { listDocumentSigners } from '@/lib/services/documents.service';
export const GET = withAuth(
withPermission('documents', 'view', async (req, ctx, params) => {
try {
const signers = await listDocumentSigners(params.id!, ctx.portId);
return NextResponse.json({ data: signers });
} catch (error) {
return errorResponse(error);
}
}),
);