[PR #1311] [MERGED] feat: update createFields api endpoint #1548

Closed
opened 2026-02-26 19:33:43 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1311
Author: @catalinpit
Created: 8/28/2024
Status: Merged
Merged: 9/2/2024
Merged by: @Mythie

Base: mainHead: feat/add-batch-fields-api


📝 Commits (10+)

  • 6c86c00 feat: update createFields api endpoint
  • ddd927c chore: extract translations
  • 332b56f fix: adding multiple fields via API
  • 403ad3e fix: created a new response schema specifically for the fields creation
  • cd2fae2 fix: fix recipient default val
  • 7f3ba51 feat: use prisma transaction for batch fields
  • c75fe57 fix: remove multiple api calls
  • bab2861 Merge branch 'main' into feat/add-batch-fields-api
  • a5d8f34 fix: createField match code
  • 480e0ac fix: restrict free signature field

📊 Changes

5 files changed (+200 additions, -97 deletions)

View changed files

📝 packages/api/v1/contract.ts (+2 -1)
📝 packages/api/v1/implementation.ts (+150 -74)
📝 packages/api/v1/schema.ts (+28 -3)
📝 packages/lib/server-only/field/create-field.ts (+16 -19)
📝 packages/lib/server-only/field/update-field.ts (+4 -0)

📄 Description

Allow users to add 1 or more fields to a document via the API.

Summary by CodeRabbit

  • New Features

    • Enhanced API functionality to support the creation of multiple fields in a single request.
    • Introduced new field types, including SIGNATURE, FREE_SIGNATURE, INITIALS, DATE, EMAIL, and NAME.
  • Schema Updates

    • Updated schema definitions to allow for handling single or multiple field creations and responses, improving organization and clarity.
  • Bug Fixes

    • Improved error handling for individual field validations, preventing one invalid field from disrupting the entire process.
    • Added validation to prevent updates for fields of type FREE_SIGNATURE, enhancing data integrity.
  • Refactor

    • Streamlined logic in the field creation process for better maintainability and flexibility.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/1311 **Author:** [@catalinpit](https://github.com/catalinpit) **Created:** 8/28/2024 **Status:** ✅ Merged **Merged:** 9/2/2024 **Merged by:** [@Mythie](https://github.com/Mythie) **Base:** `main` ← **Head:** `feat/add-batch-fields-api` --- ### 📝 Commits (10+) - [`6c86c00`](https://github.com/documenso/documenso/commit/6c86c00890a472cd324024050b4279dbb002d498) feat: update createFields api endpoint - [`ddd927c`](https://github.com/documenso/documenso/commit/ddd927cb7145b536113f7567345fc7976a2162ca) chore: extract translations - [`332b56f`](https://github.com/documenso/documenso/commit/332b56f548d72ccd501b5cb0a00f20dd2b1f99ec) fix: adding multiple fields via API - [`403ad3e`](https://github.com/documenso/documenso/commit/403ad3e079327031784de5fe02eaaea2984b16d4) fix: created a new response schema specifically for the fields creation - [`cd2fae2`](https://github.com/documenso/documenso/commit/cd2fae2df9c3adeadd28007161a4203bf97a2346) fix: fix recipient default val - [`7f3ba51`](https://github.com/documenso/documenso/commit/7f3ba511156422116db621d5e717be2be5b08dc2) feat: use prisma transaction for batch fields - [`c75fe57`](https://github.com/documenso/documenso/commit/c75fe576ee12a5fd838bd9aa72bf9f959b69b173) fix: remove multiple api calls - [`bab2861`](https://github.com/documenso/documenso/commit/bab2861bf92746e3c415187c0e3c40836a5998c9) Merge branch 'main' into feat/add-batch-fields-api - [`a5d8f34`](https://github.com/documenso/documenso/commit/a5d8f34d0b8f81bd83ab60aecd8f1cb045181e35) fix: createField match code - [`480e0ac`](https://github.com/documenso/documenso/commit/480e0ac00a7abd5d1f62b9a6bceb00ed75098fbf) fix: restrict free signature field ### 📊 Changes **5 files changed** (+200 additions, -97 deletions) <details> <summary>View changed files</summary> 📝 `packages/api/v1/contract.ts` (+2 -1) 📝 `packages/api/v1/implementation.ts` (+150 -74) 📝 `packages/api/v1/schema.ts` (+28 -3) 📝 `packages/lib/server-only/field/create-field.ts` (+16 -19) 📝 `packages/lib/server-only/field/update-field.ts` (+4 -0) </details> ### 📄 Description Allow users to add 1 or more fields to a document via the API. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced API functionality to support the creation of multiple fields in a single request. - Introduced new field types, including SIGNATURE, FREE_SIGNATURE, INITIALS, DATE, EMAIL, and NAME. - **Schema Updates** - Updated schema definitions to allow for handling single or multiple field creations and responses, improving organization and clarity. - **Bug Fixes** - Improved error handling for individual field validations, preventing one invalid field from disrupting the entire process. - Added validation to prevent updates for fields of type FREE_SIGNATURE, enhancing data integrity. - **Refactor** - Streamlined logic in the field creation process for better maintainability and flexibility. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:33:43 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1548
No description provided.