powerplatform_data_record: added meaningful error when record already exist and HTTP 405 is returned #616
+20
−1
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 pull request includes several changes to the
internal/services/data_record/api_data_record.go
andinternal/services/environment/resource_environment.go
files to improve the handling of data records and environment resources. The most important changes include adding comments to clarify the logic for determining the HTTP method, handling thehttp.StatusPreconditionFailed
status, and removing an unnecessary blank line.Improvements to data record handling:
internal/services/data_record/api_data_record.go
: Added comments to clarify the logic for choosing betweenPOST
andPATCH
methods based on the presence of primary ID attributes in the columns or record ID.internal/services/data_record/api_data_record.go
: Modified theExecute
method call to handlehttp.StatusPreconditionFailed
by attempting an update with thePATCH
method and providing an error message if the primary ID is not included.Code cleanup:
internal/services/environment/resource_environment.go
: Removed an unnecessary blank line to improve code readability.