mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 04:22:32 +10:00
fix: update field remove logic (#916)
## Description Fixed issue where you are prevented from removing fields for a recipient that has multiple fields. Example: Recipient has 3 fields, you remove 1 and proceed to next step. In the next step the field reappears as it was not deleted. ## Checklist - [X] I have tested these changes locally and they work as expected. - [X] I have added/updated tests that prove the effectiveness of these changes. - [X] I have followed the project's coding style guidelines.
This commit is contained in:
@ -56,11 +56,7 @@ export const setFieldsForDocument = async ({
|
||||
});
|
||||
|
||||
const removedFields = existingFields.filter(
|
||||
(existingField) =>
|
||||
!fields.find(
|
||||
(field) =>
|
||||
field.id === existingField.id || field.signerEmail === existingField.Recipient?.email,
|
||||
),
|
||||
(existingField) => !fields.find((field) => field.id === existingField.id),
|
||||
);
|
||||
|
||||
const linkedFields = fields
|
||||
|
||||
Reference in New Issue
Block a user