feat: add custom field clean method #62
Open
+106
−141
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR has three commits that need the review.
feat: add RemoveIDCustomField method
In this commit I've added the method to delete (only clear) custom field of the card by its ID (see "Clearing CustomFieldItems" here).
But there was a problem. Because of the definition of the
Value
field in theCustomFieldItem
result from the API was not parsed correctly.I'd tried to understand why we need here (in general purpose library) so complex unmarshaling with some kind of the business logic and stuck with that. There are no tests to explain this.
impr: change custom fields value struct
To develop this idea I've simplified
CustomFieldItem
struct and all corresponding methods. No tests was broken after that, only type actualization.impr: refactor CustomFields method
As a result I've refactor
CustomFields
card method to use more idiomatic go code and new simplifiedCustomFieldItem
struct.Conclusion
I think, that it is more correct style for the general library and type casting from the
CustomFieldItemValue
should be done in the business logic on the application level. The casting logic that was here earlier is hard to understand and did not have general application.