feat: update createFields api endpoint (#1311)

Allow users to add 1 or more fields to a document via the /document/<id>/fields API Endpoint.
This commit is contained in:
Catalin Pit
2024-09-02 14:16:48 +03:00
committed by GitHub
parent d599ab0630
commit 4c13176c52
5 changed files with 200 additions and 97 deletions

View File

@ -37,6 +37,10 @@ export const updateField = async ({
requestMetadata,
fieldMeta,
}: UpdateFieldOptions) => {
if (type === 'FREE_SIGNATURE') {
throw new Error('Cannot update a FREE_SIGNATURE field');
}
const oldField = await prisma.field.findFirstOrThrow({
where: {
id: fieldId,